select * from account_transaction where trans_type_id in ( ... long, hard-coded list ...) and account_id=? order by created desc limit 25;
You could use an index on (account_id, created, trans_type), in replacement of your index on (account_id, created). This will not prevent the "Index Scan Backwards", but at least, index rows with trans_type not matching the WHERE clause will not generate any heap access...
-- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance