mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
fa635358d2
This code is extremely shameful, don't look at it. Only goal of this PR is to demonstrate that the analyzer is able to see vector similarity indexes: ip-10-19-83-181.eu-central-1.compute.internal :) explain plan indexes=1 SELECT id, vec, L2Distance(vec, [0.0, 2.0]) FROM tab ORDER BY L2Distance(vec, [0.0, 2.0]) LIMIT 3 settings enable_analyzer = 1 EXPLAIN indexes = 1 SELECT id, vec, L2Distance(vec, [0., 2.]) FROM tab ORDER BY L2Distance(vec, [0., 2.]) ASC LIMIT 3 SETTINGS enable_analyzer = 1 Query id: 086df46e-2e27-4342-a47c-6900762a7c8c ┌─explain─────────────────────────────────────────────────────────────────────────────────────────┐ 1. │ Expression (Project names) │ 2. │ Limit (preliminary LIMIT (without OFFSET)) │ 3. │ Sorting (Sorting for ORDER BY) │ 4. │ Expression ((Before ORDER BY + (Projection + Change column names to column identifiers))) │ 5. │ ReadFromMergeTree (default.tab) │ 6. │ Indexes: │ 7. │ PrimaryKey │ 8. │ Condition: true │ 9. │ Parts: 1/1 │ 10. │ Granules: 1/1 │ 11. │ Skip │ 12. │ Name: idx │ 13. │ Description: vector_similarity GRANULARITY 100000000 │ 14. │ Parts: 1/1 │ 15. │ Granules: 1/1 │ └─────────────────────────────────────────────────────────────────────────────────────────────────┘ 15 rows in set. Elapsed: 0.007 sec. |
||
---|---|---|
.. | ||
development | ||
engines | ||
getting-started | ||
interfaces | ||
operations | ||
sql-reference |