Replies: 1 comment
-
A BTree index cannot answer this query with only a single probe, as values in the range you're asking for are not necessarily contiguous when using lexicographic order on the tuple Rather than indexes on expressions, I think your use-case would be best solved by our adding spatial indexes, which can efficiently answer multi-dimensional range queries like the one you've listed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to filter a table of cells for all cells in a 16x16 chunk, addressed by (chunk_x, chunk_y). Here is my table:
This does not compile:
I was thinking an index on expression would be useful. In PostgreSQL you can create a btree index like this:
which would support a query like:
relevant PostgreSQL docs: https://www.postgresql.org/docs/current/indexes-expressional.html
If I'm missing some obvious way of doing what I'm trying to do, please let me know 😅. I've considered just storing chunk_x and chunk_y in the table but that seems wasteful when it's computable from x and y.
Beta Was this translation helpful? Give feedback.
All reactions