pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Suderman <Nathan@pollstar.com>
To: pgsql-sql@postgresql.org
Subject: queries got slower using 7.1.3
Date: Thu, 25 Jul 2002 09:55:25 -0700
Message-ID: <sd3fcb17.081@groupwise6.pollstar.com> (raw)

I have a weird problem and don't even know where to begin.  First let me
explain what is going on.
 
I am developing on a Postgres 7.1.3 box and found this unexplainable
delay on this query
 
select * from webfinal where w_artistkey = 'MICBUR' order by w_date
offset 2 limit 4;
 
I get at least a 8-9 second delay.  If I take either the 'order by' or
the 'limit' off the results are immediate.  I have several other
postgres boxes 7.1.1 and there is no delay using this query, here is
what I'm getting with explain, but I don't know why?
 
notifydev=# explain select * from webfinal where w_artistkey = 'MICBUR'
order by w_date offset 2 limit 4;
NOTICE:  QUERY PLAN:
 
Limit  (cost=39.97..119.91 rows=4 width=109)
  ->  Index Scan using webfinal_w_date on webfinal 
(cost=0.00..10563.49 rows=529 width=109)
 
EXPLAIN
notifydev=# explain select * from webfinal where w_artistkey = 'MICBUR'
order by w_date offset 2;        
NOTICE:  QUERY PLAN:
 
Limit  (cost=999.97..999.97 rows=527 width=109)
  ->  Sort  (cost=999.97..999.97 rows=529 width=109)
        ->  Index Scan using wf_ak1023165516 on webfinal 
(cost=0.00..976.06 rows=529 width=109)
 
EXPLAIN
 
Now I run explain on a 7.1.3 box
news=# explain select * from webfinal where w_artistkey = 'MICBUR'
order by w_date offset 2 limit 4;
NOTICE:  QUERY PLAN:
 
Limit  (cost=924.71..924.71 rows=4 width=109)
  ->  Sort  (cost=924.71..924.71 rows=498 width=109)
        ->  Index Scan using wf_ak1027580700 on webfinal 
(cost=0.00..902.38 rows=498 width=109)
 
EXPLAIN
 
can someone explain this to me? Please send response directly as I am
not on the list.

Message-ID: <sd3fcb17.081@groupwise6.pollstar.com>
Permalink:  ../sd3fcb17.081@groupwise6.pollstar.com/
Also on:    postgresql.org/message-id/sd3fcb17.081@groupwise6.pollstar.com

 · 

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-sql@postgresql.org
  Cc: Nathan@pollstar.com
  Subject: Re: queries got slower using 7.1.3
  In-Reply-To: <sd3fcb17.081@groupwise6.pollstar.com>

* 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