Project: datamanagement
Issue DM-626: ORDER BY and DISTINCT do not work reliably in qserv
Queries with ORDER BY and DISTINCT are buggy. For example, results do not always come ordered and order changes from one run to another: {code} mysql> SELECT objectId FROM Object WHERE qserv_areaspec_box(0, 0, 3, 10) ORDER BY objectId; +-----------------+ | objectId | +-----------------+ | 417857368235490 | | 417861663199589 | | 417865958163688 | | 420949744686724 | | 420954039650823 | | 424042121137958 | | 424046416102057 | | 427134497589192 | | 430226874040426 | +-----------------+ 9 rows in set (1.27 sec) mysql> SELECT objectId FROM Object WHERE qserv_areaspec_box(0, 0, 3, 10) ORDER BY objectId; +-----------------+ | objectId | +-----------------+ | 424042121137958 | | 424046416102057 | | 427134497589192 | | 430226874040426 | | 417857368235490 | | 417861663199589 | | 417865958163688 | | 420949744686724 | | 420954039650823 | +-----------------+ 9 rows in set (1.24 sec) {code} This was done with testdata/case01 data, let me know if you need to load that data. Also, using case03 data, e.g. {code} SELECT distinct run, field FROM Science_Ccd_Exposure WHERE run = 94 AND field = 535; {code} returns 6 rows in qserv (vs 1 in mysql). The full list of DISTINCT failures is (all with testdata/case03): - 0002_fetchRunAndFieldById.txt - 0021_selectScienceCCDExposure.txt - 0030_selectScienceCCDExposureByRunField.txt
Story points: 1