pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: aurora <aurora00@gmail.com>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: browsing table with 2 million records
Date: Wed, 26 Oct 2005 14:22:58 -0700
Message-ID: <cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.com> (raw)
In-Reply-To: <1130360385.1156.12.camel@archimedes>
References: <cbd177510510261341l4ed7a214lda9d67af12f2ec21@mail.gmail.com>
	<1130360385.1156.12.camel@archimedes>

>> select * from table order by date limit 25 offset 0

> Do you have an index on the date column? Can you post an EXPLAIN
> ANALYZE for the slow query?

Wow! Now that I look again there are actually 2 date fields. One is indexed
and one is not. Order by was done on the column without index. Using the
indexed column turn a seq scan into index scan and the query performance is
totally fine now.

It would still be helpful if select count(*) can perform well.

Thanks!

Wy

view thread (12+ messages)  latest in thread

Message-ID: <cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.com>
Permalink:  ../cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.com/
Also on:    postgresql.org/message-id/cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.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-performance@postgresql.org
  Cc: aurora00@gmail.com, mark.lewis@mir3.com
  Subject: Re: browsing table with 2 million records
  In-Reply-To: <cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.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