ClickHouse / ClickHouse/ClickHouse
Lateral Joins
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
> (you don't have to strictly follow this form)
Lateral joins are fantastic for workloads primarily used in ClickHouse environments: time-series/logs/analytics/etc. that trace the history of an object's values throughout time
in particular, lateral joins make writing correlated subqueries far easier
```
SELECT * FROM (
SELECT DISTINCT ON (ID) *
WHERE ID = ANY($1)
FROM PRICES
ORDER BY ID, TIMESTAMP DESC
) PRICE LEFT JOIN LATERAL (
..... other info
) LEFT JOIN LATERAL (
..... other info
)
```
> A clear and concise description of what is the intended usage scenario is.
Support for lateral joins
Why not use normal joins? It will duplicate rows during join process before filtering on distinct at the end, causing major performance degradation
Contributor guide
Assessment
This issue has not been assessed yet.