On Thu, Mar 5, 2009 at 1:30 PM, Tom Lane wrote:
> Jonathan Hseu writes:
>> Sort (cost=11684028.44..11761274.94 rows=30898601 width=40)
>> Sort Key: "time"
>> -> Bitmap Heap Scan on ticks (cost=715657.57..6995196.08 rows=30898601
>> width=40)
>> Recheck Cond: (contract_id = 1)
>
Oops, forgot to CC my reply to the list. Sorry if this gets messed up.
On Thu, Mar 5, 2009 at 12:30 PM, Tom Lane wrote:
> Jonathan Hseu writes:
> > Sort (cost=11684028.44..11761274.94 rows=30898601 width=40)
> >Sort Key: "time"
> >-> Bitmap Heap Scan on ticks (cost=715657.57..69951
Jonathan Hseu writes:
> Sort (cost=11684028.44..11761274.94 rows=30898601 width=40)
>Sort Key: "time"
>-> Bitmap Heap Scan on ticks (cost=715657.57..6995196.08 rows=30898601
> width=40)
> Recheck Cond: (contract_id = 1)
> -> Bitmap Index Scan on contract_id_time_idx
I have a relatively simple query with a single index on (contract_id, time):
vjtrade=> EXPLAIN SELECT * FROM ticks WHERE contract_id=1 ORDER BY time;
QUERY
PLAN