Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matriv/b40f8ac9e55ca616e7f12b31bd4b02af to your computer and use it in GitHub Desktop.
Save matriv/b40f8ac9e55ca616e7f12b31bd4b02af to your computer and use it in GitHub Desktop.
Left table 5x bigger Right table, Left table gets distributed to preserve the OrderBy
select t2.id1, t1.id1 from matriv.t2, matriv.t1 where t2.id1=t1.id1 order by 1 limit 2000
select t2.id1, t1.id1 from matriv.t2, matriv.t1 where t2.id1=t1.id1 and t2.id2=t1.id2 order by 1 limit 2000
| All rows match conc=1 | All rows match conc=15 | 4/5 of rows filtered out conc=1 | 4/5 of rows filtered out conc=1
================+========================+========================+=================================+================================
Distributed | 2135.051 | 5307.234 | 3383.737 | 9010.810
----------------+------------------------+------------------------+---------------------------------+--------------------------------
Non-distributed | 10768.582 | 29048.164 | 17138.134 | 42107.285
----------------+------------------------+------------------------+---------------------------------+--------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment