Re: why postgresql is so slow? - Mailing list pgsql-hackers

From Richard Huxton
Subject Re: why postgresql is so slow?
Date
Msg-id 200309201109.34306.dev@archonet.com
Whole thread Raw
In response to why postgresql is so slow?  ("Jinqiang Han" <postgresql@db.pku.edu.cn>)
List 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


pgsql-hackers by date:

Previous
From: "Jinqiang Han"
Date:
Subject: why postgresql is so slow?
Next
From: Carlos Guzman Alvarez
Date:
Subject: Re: Array Parameters on protocol 3.0