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

Added a q3c_sindist_bool function to allow for calculating a better Selectivity #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gshennessy
Copy link

Have a selectivity function for q3c_sindist_bool.

@segasai
Copy link
Owner

segasai commented Oct 18, 2023

I looked at the patch, but I actually forgot that I already have selectivity on for the q3c_join() so nothing is needed there. It is done through the weird operator

AND ($5::double precision ==<<>>== ($1,$2,$3,$4)::q3c_type)

with this selectivity function

q3c/q3c.c

Line 94 in 040de14

Datum pgq3c_sel(PG_FUNCTION_ARGS)

In fact

explain select * from gaia_dr3.gaia_source as g, gaia_dr3.gaia_source as g1 where q3c_join(g.ra,g.dec,g1.ra,g1.dec,5./3600);

estimates the number of rows to be 60 millions which is pretty sensible (given it asssumes independent positions).

So I don't think q3c_join can be improved with your patch. What I can do is to do the same thing for q3c_radial_query() which currently doesnt' have the selectivity implemented

@gshennessy
Copy link
Author

I need to do more A/B testing, if only for my own understanding.

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

Successfully merging this pull request may close these issues.

2 participants