Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(synthese): order by descending date_min and id_synthese
For Synthese queries involving blurring: - Add first order_by on descending date_min > this allows to retrieve up-to-50000 more-recently-dated observations from the up-to-100000 observations of the 2 unioned queries - Set (now) second order_by on id_synthese from ascending to descending > this allows, for several observations with same date_min, to prioritize more-recently-added-in-database observations Notes: - We want to preserve the final order_by on `allowed_geom_cte.c.priority` and the distinct clause on id_synthese, to keep only precise geom for obs retrieved in both precise and blurred subqueries: this requires to: - Keep the order_by on id_synthese - The wish to retrieve "more recent" observations may be understood in two ways: - Meant as "more-recently-dated": operated by the first order_by > it is thus assumed this is the preferred meaning given to "more recent" - Meant as "more-recently-added-in-database": operated by the second order_by > it is thus assumed that for two observations with the same date_min we qualify as "more recent" the one with the greater id_synthese Solves #3249 Co-authored-by: VincentCauchois <vincent.cauchois@mnhn.fr> Co-authored-by: Christophe Ramet <christophe.ramet@mnhn.fr>
- Loading branch information