Timeline for Postgres sometimes uses inferior index for WHERE a IN (...) ORDER BY b LIMIT N
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2019 at 20:53 | comment | added | Arne Claassen | It's not that ORM won't let me generate custom SQL, it's that the query is automatically generated as part of the REST API machinery. I can probably suppress that for the couple of places where this is applicable, but would certainly prefer fixing it at the source rather through a special case of tech debt. | |
Sep 25, 2019 at 20:49 | comment | added | Laurenz Albe |
Any ORM worth its salt will let you write queries in SQL. How about creating a view AS SELECT id + 0 AS id, ... ?
|
|
Sep 25, 2019 at 20:44 | comment | added | Arne Claassen | That does indeed work. Unfortunately the queries are generated by the Django ORM and only certain scenarios would this really be the desirable behavior, so it's probably not a solution we can deploy. | |
Sep 25, 2019 at 19:59 | history | answered | Laurenz Albe | CC BY-SA 4.0 |