Re: why postgresql is so slow?

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Jinqiang Han" <postgresql(at)db(dot)pku(dot)edu(dot)cn>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: why postgresql is so slow?
Date: 2003-09-20 10:09:34
Message-ID: 200309201109.34306.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Saturday 20 September 2003 10:38, Jinqiang Han wrote:
> hello, all.

This isn't really a hackers question - perhaps try the "general","sql" etc
lists in future. This list is for questions about the source-code of PG.

> I have a table about 2 million rows. when I run "select * from table1" in
> psql, it will take me about 10 minutes to get the result. I wonder if
> postgresql can immediately return result like db2.

PG is returning *all* the rows you requested. If you want one row at a time,
perhaps use a cursor.

> After that I create a index on a column named id. The time executing
> "selct * from table1 where id=10" in psql is much faster than that of
> executing "select * from table1 where id <10" in psql. why?

Because there are more records returned? You don't supply enough information.
If you'd like to repost to the general list, along with details of the tables
and the output of EXPLAIN ANALYSE for your queries, I'll be glad to go into
detail there.
--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff 2003-09-20 10:14:29 Re: why postgresql is so slow?
Previous Message Jinqiang Han 2003-09-20 09:38:25 why postgresql is so slow?