You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first two queries below are slow due to missing optimization.
The last query is fast - this is how them are supposed to be optimized.
milovidov-desktop :) SELECT * FROM (SELECT * FROM numbers(1000000000) ORDER BY number UNION ALL SELECT * FROM numbers(1000000000) ORDER BY number) ORDER BY number LIMIT 10
SELECT *
FROM
(
SELECT *
FROM numbers(1000000000)
ORDER BY number ASC
UNION ALL
SELECT *
FROM numbers(1000000000)
ORDER BY number ASC
)
ORDER BY number ASC
LIMIT 10
Query id: ad5e3c17-6840-480a-ae12-27fe90d60e71
Cancelling query.
Ok.
Query was cancelled.
0 rows in set. Elapsed: 2.809 sec. Processed 203.20 million rows, 1.63 GB (72.34 million rows/s., 578.76 MB/s.)
milovidov-desktop :) SELECT * FROM (SELECT * FROM numbers(1000000000) ORDER BY number UNION ALL SELECT * FROM numbers(1000000000) ORDER BY number) LIMIT 10
SELECT *
FROM
(
SELECT *
FROM numbers(1000000000)
ORDER BY number ASC
UNION ALL
SELECT *
FROM numbers(1000000000)
ORDER BY number ASC
)
LIMIT 10
Query id: 98d7340d-4efb-4c13-aa4a-2dddb3aa0602
→ Progress: 241.58 million rows, 1.93 GB (73.05 million rows/s., 584.37 MB/s.) ███████████████████▌ 11%^Cancelling query.
Ok.
Query was cancelled.
0 rows in set. Elapsed: 3.509 sec. Processed 256.45 million rows, 2.05 GB (73.09 million rows/s., 584.70 MB/s.)
milovidov-desktop :) SELECT * FROM (SELECT * FROM numbers(1000000000) ORDER BY number LIMIT 10 UNION ALL SELECT * FROM numbers(1000000000) ORDER BY number LIMIT 10) ORDER BY number LIMIT 10
SELECT *
FROM
(
SELECT *
FROM numbers(1000000000)
ORDER BY number ASC
LIMIT 10
UNION ALL
SELECT *
FROM numbers(1000000000)
ORDER BY number ASC
LIMIT 10
)
ORDER BY number ASC
LIMIT 10
Query id: a550a49f-a792-4084-8294-e6e6304281ce
┌─number─┐
│ 0 │
│ 0 │
│ 1 │
│ 1 │
│ 2 │
│ 2 │
│ 3 │
│ 3 │
│ 4 │
│ 4 │
└────────┘
10 rows in set. Elapsed: 0.794 sec. Processed 2.00 billion rows, 16.00 GB (2.52 billion rows/s., 20.16 GB/s.)
The text was updated successfully, but these errors were encountered:
The first two queries below are slow due to missing optimization.
The last query is fast - this is how them are supposed to be optimized.
The text was updated successfully, but these errors were encountered: