News for hackers. Stuff that matters.
Re:Pg_hint_plan: Force PostgreSQL to execute query plans the... by matthewbauer on Saturday March 16, 2024 @02:34PM (#39728293)
That sounds like the pg stats are messed up somehow. Try running explain analyze foo to see if it changes things.

Postgres doesn’t automatically create indexes - I bet the others have some implicit index on organization_id, created_at. Otherwise they would be giving bad results in other cases. I don’t see why you can’t just make that index in postgres.

Re:Pg_hint_plan: Force PostgreSQL to execute query plans the... by zac23or on Saturday March 16, 2024 @03:01PM (#39728515)
>Pg stats are messed up somehow. Try running explain analyze foo

I did

> Postgres doesn’t automatically create indexes

Both fields have indexes (created manually). Postgres is incorrectly choosing the index in order by column, not the index in the where clause.