pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Anj Adu <fotographs@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: slow index lookup
Date: Tue, 22 Jun 2010 22:01:53 -0400
Message-ID: <11812.1277258513@sss.pgh.pa.us> (raw)
In-Reply-To: <1277250226-sup-6686@alvh.no-ip.org>
References: <AANLkTimoNh8cPlwR5oYE9jdmr4aR3ThAxpnAsmnujIYK@mail.gmail.com>
	<1277250226-sup-6686@alvh.no-ip.org>

Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Anj Adu's message of mar jun 22 17:44:39 -0400 2010:
>> This query seems unreasonable slow on a well-indexed table (13 million
>> rows). Separate indexes are present on guardid_id , from_num and
>> targetprt columns.

> Maybe you need to vacuum or reindex?

Rethinking the set of indexes is probably a more appropriate suggestion.
Separate indexes aren't usefully combinable for a case like this --- in
principle the thing could do a BitmapAnd, but the startup time would be
pretty horrid, and the LIMIT 1 is discouraging it from trying that.
If this is an important case to optimize then you need a 3-column index.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <11812.1277258513@sss.pgh.pa.us>
Permalink:  ../11812.1277258513@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11812.1277258513@sss.pgh.pa.us

 · 

reply

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, alvherre@commandprompt.com, fotographs@gmail.com
  Subject: Re: slow index lookup
  In-Reply-To: <11812.1277258513@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