Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

Next:From: Greg SmithDate: 2007-06-20 15:21:01
Subject: Re: Volunteer to build a configuration tool
Previous:From: Andrew SullivanDate: 2007-06-20 15:06:46
Subject: Re: Replication

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group