Re: Why we don't want hints Was: Slow count(*) again... - Mailing list pgsql-performance

From Pierre C
Subject Re: Why we don't want hints Was: Slow count(*) again...
Date
Msg-id op.vqqt8ihaeorkce@apollo13
Whole thread Raw
In response to Re: Why we don't want hints Was: Slow count(*) again...  (Tobias Brox <tobixen@gmail.com>)
List pgsql-performance
>    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...

pgsql-performance by date:

Previous
From: Cesar Arrieta
Date:
Subject: Unblock tables
Next
From: Scott Marlowe
Date:
Subject: Re: Unblock tables