Re: Slow indexscan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow indexscan
Date
Msg-id 17907.1182352197@sss.pgh.pa.us
Whole thread Raw
In response to Slow indexscan  ("Mikko Partio" <mpartio@gmail.com>)
Responses Re: Slow indexscan
Re: Slow indexscan
List pgsql-performance
"Mikko Partio" <mpartio@gmail.com> writes:

>  Index Scan using tbl_20070601_pkey on tbl_20070601 t1
> (cost=0.00..365.13rows=13 width=137) (actual time=
> 120.83..10752.64 rows=539 loops=1)
>    Index Cond: ((validtime >= 20070602000000::bigint) AND (validtime <=
> 20070602235500::bigint) AND (latitude = 60.2744::double precision) AND
> (longitude = 26.4417::double precision))
>    Filter: (parname = 'temperature'::character varying)

You do realize that's going to scan the entire index range from
20070602000000 to 20070602235500?

If this is a typical query you'd be better off putting the lat/long
columns first in the index.

            regards, tom lane

pgsql-performance by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Replication
Next
From: Greg Smith
Date:
Subject: Re: Volunteer to build a configuration tool