Topic: Performance & Tuning >> count(*) and count(1)
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: count(*) and count(1) |
| Thunderchicken |
Posted: Dec 26, 2002 04:12:00 PM |
Total Post: 1
Joined: Jan, 2003
|
Hi All,
Is there any performance issues when running a select count (*) instead of select count (1) or select count (rowid) statement?
Thanks,
Miller
|
|
|
tonny_2003 |
| Posted: Dec 26, 2002 04:17:00 PM | |
|
Total Post: 6
Joined: Jan, 2003
|
I think count (*) will be a full table scan irrespective of the indexes present on
the table whereas Count (1) will only scan the index space provided the column1 is indexed. So count (1) should be faster since less bytes will be read.
Thanks,
Vimal
|
|
|
|
|
vasu |
| Posted: Dec 26, 2002 04:27:00 PM | |
|
Total Post: 50
Joined: Jan, 2003
|
Probably count(*) is less performing than count(1).
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 814 |
| Mohammed Taj | 694 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| positive fanatic | 361 |
| Gitesh Trivedi | 322 |
| Gopu Gopi | 242 |
| neeraj sharma | 228 |
| Ramesh Jois | 226 |
| Bishal Khetan | 169 |
|
|