From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mikko Partio <mpartio@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow indexscan
Date: Wed, 20 Jun 2007 11:09:57 -0400
Message-ID: <17907.1182352197@sss.pgh.pa.us> (raw)
In-Reply-To: <2ca799770706200702y1074f066s61279b67f93315d0@mail.gmail.com>
References: <2ca799770706200702y1074f066s61279b67f93315d0@mail.gmail.com>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, mpartio@gmail.com
Subject: Re: Slow indexscan
In-Reply-To: <17907.1182352197@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox