3 ms·
From my experience, most of my waiting time is IO, not CPU load. Even simple stuff, such as SELECT COUNT(*) to display total count in grid on big table can take
by czechdeveloper 8y ago
From my experience, most of my waiting time is IO, not CPU load. Even simple stuff, such as SELECT COUNT(*) to display total count in grid on big table can take seconds. It does not have to be complicated.
- rypskar 8y ago>Even simple stuff, such as SELECT COUNT(*) edit seems like my old performance book was outdated or wrong :(
- ianamartin 8y agoNope. Not even close.
- czechdeveloper 8y agoSELECT COUNT(*) should be the one which is resolved by index/metadata
- ianamartin 8y agoYou have a problem. And it’s probably related to your db architecture, which was probably designed by devs with ORMs.
- olavk 8y agoWhat kind of database architecture could cause SELECT * to be slow?
- kyberias 8y agoAny. "Architecture" has nothing to do with that. SELECT COUNT(*) is usually "slow".
- deleted 8y ago[deleted]
- theandrewbailey 8y agoMakes sense: devs with ORMs don't know about indexes, which are proper DB architecture.
- deleted 8y ago[deleted]
- kyberias 8y agoYou may be confused about how databases work. COUNT(*) is not "simple stuff". It almost always involves an index _scan_. For tables with millions of rows, it takes a while.