New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query not using indices when using columnar storage #7524
Comments
Similar to #7202. |
Hey @vbergeron-ledger, Columnar is more inclined to use the index if the predicates in the where clause are based on some equality filters. And when using range based predicates, I'd expect columnar to prefer ColumnarScan because it would be much faster than an index-scan on columnar tables --due to underlying index support implementation in columnar. And ColumnarScan performs best when it can make use of chunk group filtering. When this is the case, you can see which filters are used for chunk group filtering in the EXPLAIN output ( QUERY PLAN
---------------------------------------------------------------------
Custom Scan (ColumnarScan) on simple_chunk_filtering (actual rows=111111 loops=1)
Filter: (i > 123456)
Rows Removed by Filter: 3457
Columnar Projected Columns: i
Columnar Chunk Group Filters: (i > 123456)
Columnar Chunk Groups Removed by Filter: 12 However, this doesn't seem like the case for your query. To understand why this is so, could you re-run the query by first setting NOTICE: columnar planner: cannot push down clause: .... And if you can share that log line, I can help you further. |
Hello and thanks for your detailed reply. |
And here it comes :
Resulting plan is kind of the same as before. |
There must be something going wrong with the planner because the reason stated in NOTICE is not much applicable for |
if it can add more context, when specifying more columns on conditions that should also use a more complex index :
So it happens on every pushdowns. |
Another feedback : I managed to get the predicate pushdown working : this is caused by a domain type. the performance of the |
PG 15
Citus 12.1
I am evaluating the columnar storage to compress old data for our use case.
So far the compression ratio is great, but the querying is very slow.
After analysis, and despite defining a primary key index, all queries are scanning the whole table.
(Domain model is ethereum call data)
Schemas :
Exemple of a query that should be fast using the index (as index support is claimed in the documentation) :
We can see clearly no index usage in the plan.
For reference, here is the plan for the regular table.
I have the feeling I am either not using the whole columnar store correctly or there is some pitfall in the planner regarding costs.
The text was updated successfully, but these errors were encountered: