![]() |
Does Count(*) consume more memory?
Just wondering does of both of them consume the same amount of memory??... let say i have 5 column in the table.
PHP Code:
|
Although I cant say for sure, but count(*) would in theory take more since it has to find what all the columns are and count them.
|
i think they would both use about the same seeing as whichever you use they both just count the nunber of rows.
|
Quote:
|
i understand that but, and i may be wrong, count is optimized for speed and regardless of the selected column the number of rows will always be the same. so i dont see why this should affect the speed. i might be wrong though.
|
Saying * still makes it resolve for every row in the table, not a giant difference, but using * will be slower.
|
Have a read of this, its very interesting.
http://www.mysqlperformanceblog.com/...t-vs-countcol/ |
| All times are GMT. The time now is 12:15 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0