pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@paradise.net.nz>
To: morandell@gmail.com
Cc: Qingqing Zhou <zhouqq@cs.toronto.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: QRY seems not using indexes
Date: Tue, 09 Aug 2005 17:05:39 +1200
Message-ID: <42F839A3.2080501@paradise.net.nz> (raw)
In-Reply-To: <dd9bm4$238b$1@news.hub.org>
References: <1123071402.641229.314250@g43g2000cwa.googlegroups.com>
	<dd9bm4$238b$1@news.hub.org>

Qingqing Zhou wrote:
> <morandell@gmail.com> writes
> 
>>
>>so, if I do a qry like "EXPLAIN ANALYZE select * from pridecdr where
>>idsede=8977758488" it tooks a lot of time before i get back any result:
>>
>>Index Scan using prd_id_sede on pridecdr  (cost=0.00..699079.90
>>rows=181850 width=138) (actual time=51.241..483068.255 rows=150511
>>loops=1)
>>   Index Cond: (idsede = 8977758488::bigint)
>> Total runtime: 483355.325 ms
>>
> 
> 
> The query plan looks ok. Try to do EXPLAIN ANALYZE twice and see if there is
> any difference. This could reduce the IO time to read your index/data since
> you got enough RAM.
> 
> Also, if you haven't done VACUUM FULL for a long time, do so and compare the
> difference.
> 

Could also be libpq buffering all 150000 rows before showing any.

It might be worthwhile using a CURSOR and doing 1 FETCH. If that is 
quick, then buffering is probably the issue. BTW - do you really want 
all the rows?

Cheers

Mark



view thread (2+ messages)

Message-ID: <42F839A3.2080501@paradise.net.nz>
Permalink:  ../42F839A3.2080501@paradise.net.nz/
Also on:    postgresql.org/message-id/42F839A3.2080501@paradise.net.nz

 · 

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: markir@paradise.net.nz, morandell@gmail.com, zhouqq@cs.toronto.edu
  Subject: Re: QRY seems not using indexes
  In-Reply-To: <42F839A3.2080501@paradise.net.nz>

* 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