Skip to content
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

Removing queryables indices #225

Open
drnextgis opened this issue Oct 27, 2023 · 2 comments
Open

Removing queryables indices #225

drnextgis opened this issue Oct 27, 2023 · 2 comments

Comments

@drnextgis
Copy link
Collaborator

I notice that in #210, eo:cloud_cover has been excluded from the list of queryables. Is there a function available to also remove the corresponding index from all partitions, or is this a manual task? Also I'm curious about the choice to initially use the to_int property wrapper there instead of to_float. Are there any specific advantages to using it in this context?

@bitner
Copy link
Collaborator

bitner commented Nov 7, 2023

The maintain_partitions can be used to make sure that all indexes match what is defined in the queryables table. Generally, you do not need to manually call this function as it will be called by triggers on the queryables table as well as on when running the check_partition function. When called by a trigger, the behavior will be to not remove any indexes that don't match the desired indexes as defined by queryables.

You can run by hand to remove any indexes using `SELECT maintain_partitions('items',TRUE);

BTREE indexes as of Postgres 15 (maybe it was 14, not sure off the top of my head) allow for deduplication of identical rows which means that an index on a casted floats to int can be much smaller/faster than the same index would be on a float. The smaller matters less about disk space, but more in that the entire index is more likely to stay in memory. This is, of course, at the cost of precision, but for fields where that precision may not be critical, it can be advantageous to index as ints.

@zacdezgeo
Copy link
Collaborator

@bitner, should we plan on adding anything about this to the docs? Maybe under the indexes section in docs/src/pgstac.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants