0 votes
10 views
Hi,

I'm getting stuck while trying to search using a Q3C_JOIN alongside other WHERE statements. Here is the query:

SELECT

vis.band, vis.alpha_j2000, vis.delta_j2000, vis.mag_auto, vis.number,

nisp.band, nisp.alpha_j2000, nisp.delta_j2000, nisp.mag_auto, nisp.number

FROM euclid_ero.ngc6822_vis AS vis, euclid_ero.ngc6822_nisp AS nisp

WHERE vis.alpha_j2000 BETWEEN 296.257279 AND 296.466642

AND vis.delta_j2000 BETWEEN -14.823528 AND -14.804142

AND 't' = Q3C_JOIN(nisp.alpha_j2000 , nisp.delta_j2000, vis.alpha_j2000, vis.delta_j2000, 0.000028)

When I do the query using only the Q3C_JOIN or only the limits on alpha_j2000 and delta_j2000, the query gives back results. It is when I combine them both that it gets stuck. I am trying to do the Q3C_JOIN for smaller parts of the sky, because the table gives back over the max results when not limiting anything using just Q3C_JOIN. Is there a better way of going about this?
by zcoustier (130 points) | 10 views

1 Answer

+1 vote

The q3c functions sometimes do not work properly when using additional where clauses. See the common performance issues in the q3c documentation.

To work around this you can create a MyDB table, index it and then proceed to run the `q3c_join`. See the answer on this related question for specific syntax.

ago by chadddemo (240 points)

477 questions

488 answers

479 comments

675 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories