Today I issued the following with timeout of 300 seconds:
select ra,dec,av,pmracosd,pmdec,vrad,mu0,label as evol_label,logte as logT,logg,logl as logL,z as Z,umag,gmag,rmag,imag,zmag,ymag from lsst_sim.simdr2 where ring256 in (611564).
It returned successfully in less than a minute with about 2.4 million rows. Then I tried
select ra,dec,av,pmracosd,pmdec,vrad,mu0,label as evol_label,logte as logT,logg,logl as logL,z as Z,umag,gmag,rmag,imag,zmag,ymag from lsst_sim.simdr2 where ring256 in (613612, 611564)
It took perhaps a little longer than a minute and returned about 3.9 million rows. Finally I increased the timeout value to 590 seconds and issued
select ra,dec,av,pmracosd,pmdec,vrad,mu0,label as evol_label,logte as logT,logg,logl as logL,z as Z,umag,gmag,rmag,imag,zmag,ymag from lsst_sim.simdr2 where ring256 in (613612, 612588, 612587, 611564)
The result should have been about 8 million rows. This raised an exception with the Gateway Time-out error in 3 or 4 minutes, well under the timeout value I supplied.
I can split the query into two smaller queries, but why do I need to? Is the total amount of data to be returned (about 8 million rows by 18 columns) the issue?