Postgresql – multiple orders slower when adding additional OR to WHERE condition
In a PostgreSQL 14 database I have a transactions table currently containing around 400 million elements and the following query on it: SELECT "transactions"."id" FROM "transactions" WHERE ("wallet_id" = $1) ORDER BY "transactions"."id" DESC LIMIT 10 This works fine and…