Re: Slow indexscan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mikko Partio" <mpartio(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow indexscan
Date: 2007-06-20 15:09:57
Message-ID: 17907.1182352197@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Mikko Partio" <mpartio(at)gmail(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2007-06-20 15:21:01 Re: Volunteer to build a configuration tool
Previous Message Andrew Sullivan 2007-06-20 15:06:46 Re: Replication