From: | 旭斌 裴 <peixubin(at)yahoo(dot)com(dot)cn> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | table full scan or index full scan? |
Date: | 2009-10-12 01:17:28 |
Message-ID: | 274837.92053.qm@web15001.mail.cnb.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I have a 30,000,000 records table, counts the record number to need for 40 seconds.
The table has a primary key on column id;
perf=# explain select count(*) from test;
...
-----------------------------------------
Aggregate (cost=603702.80..603702.81 rows=1 width=0)
-> Seq scan on test (cost=0.00..527681.04 rows=30408704 width=0)
...
perf=# select count(*) from test;
count
------------
30408704
perf=#
The
postgresql database uses the table full scan.but in oracle, the similar
SQL uses the index full scanning,speed quickly many than postgresql.
postgresql's optimizer whether to have the necessity to make the adjustment?
postgresql version:8.3.7
OS : ubuntu 9
kernel:2.6.28-15-generic x86_64
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Bill Todd | 2009-10-12 02:41:54 | Nested transactions |
Previous Message | CISSE 2009 | 2009-10-12 01:15:55 | CISSE 2009 - Paper Submission Deadline Extended to October 26, 2009. |