dieterich-lab / scimodom

GNU Affero General Public License v3.0
0 stars 0 forks source link

Search view data sort order #61

Closed eboileau closed 4 months ago

eboileau commented 6 months ago

Aims/objectives.

Using (DataTable) presort

:multiSortMeta="[
    { field: 'chrom', order: 1 },
    { field: 'start', order: 1 }
]"

in DataTable breaks everything...?

A clear and concise description of todo items.

Even if we "pre-sort" each bedRMod dataset at upload, the Search display combines multiple dataset, so we may need to add a default .order_by(Data.chrom, Data.start), when there is no explicit sorting.

eboileau commented 4 months ago

We do not use DataTable presort. Unless sorting is explicitly added, this is sorted by default in the BE with query.order_by(Data.chrom.asc(), Data.start.asc()) on idx_data_sort. Explicit sorting by chrom,chrom and start, or any single sorting of score, frequency, coverage has an index, however I'm not sure whether MySQL uses the index in desc, or say asc and desc? Any other combination of sort columns and order cannot rely on indexes. If this becomes problematic, we might have to rethink how this is done.