Topic: Performance & Tuning >> count(1) versus count(*)
|
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(1) versus count(*) |
| tuslerb |
Posted: Feb 15, 2003 12:34:00 AM |
Total Post: 1
Joined: Jan, 2003
|
Hi Guys,
Is there any performance issues when running a select count(1) instead of select count(*)?
Thanks,
Amy
|
|
|
Sabari Nath |
| Posted: Feb 15, 2003 12:38:00 AM | |
|
Total Post: 16
Joined: Jan, 2003
|
Hi Amy,
I think count(*) will do a full table scan irrespective of the indexes present on
the table and Count(1) will only scan the indexspace provided the column1 is indexed and should be faster since less bytes will be read.
Vasu.
|
|
|
|
|
uci_001 |
| Posted: Feb 15, 2003 12:40:00 AM | |
|
Total Post: 1
Joined: Jan, 2003
|
I believe count(1) or count(rowid) should be faster than count(*).
Count(*) will use all the columns and might degrade the performance.
|
|
|
|
|
| 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 | 239 |
| neeraj sharma | 228 |
| Ramesh Jois | 226 |
| snehalatha p | 169 |
|
|