Hello, thanks for reaching out, and sorry for the long delay in responding. Your query is almost correct. I ran this one (using the 'datalab' command line client on my laptop), and it produced a file of over 4M rows in 2 minutes:
datalab query sql="SELECT t.ls_id, t.ra, t.dec, t.dered_flux_g, t.dered_flux_r, t.dered_flux_z, t.flux_g, t.flux_r, t.flux_z, t.shape_r, t.sersic, t.flux_w1, t.flux_w2, t.flux_w3, t.flux_w4, t.flux_ivar_w1, t.flux_ivar_w2, t.flux_ivar_w3, t.flux_ivar_w4, t.w1_w2, t.w2_w3, t.w3_w4 FROM ls_dr9.tractor AS t INNER JOIN ls_dr9.x1p5__tractor__sdss_dr17__specobj as s ON t.ls_id = s.id1" > xmatch.csv
You can install the command line client with pip:
pip install --ignore-installed --no-cache-dir astro-datalab
Then, log in once (datalab login), and finally run your query.
Best,
Robert