Hi,
I would like to crossmatch a user catalogue that contains about 6000 rows with ls_dr8.tractor and the resulting catalogue with various other SDSS and LS tables. Naively, I would have done something like this:
SELECT
/* Object properties */
CAT.name, CAT.ra, CAT.dec,
/* LS Photometry */
tractor.dered_mag_g,
/* SDSS photometry */
sdss_phot.dered_g
FROM mydb://mycat AS CAT, ls_dr8.tractor AS tractor
INNER JOIN sdss_dr16.x1p5__specobj__ls_dr8__tractor_primary AS tractor_sdss ON tractor_sdss.id2 = tractor.ls_id
INNER JOIN sdss_dr16.photoplate AS sdss_phot ON sdss_phot.objid = sdss.bestobjid
WHERE 't' = q3c_radial_query(tractor.ra, tractor.dec, CAT.ra, CAT.dec, 0.001)
But this is inefficient and triggers a runtime error if I don't limit the query to a few objects. I tried to set up a nested query but didn't manage to set it up correctly. Could you give me a suggestion to make this query efficient?
Cheers,
Steve