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 ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster