ramtops: (Default)
[personal profile] ramtops
this is now part of our in-house coding standards:
SELECT count(*) as dracula FROM image

(no subject)

Date: 2006-01-19 12:14 pm (UTC)
ext_17706: (Default)
From: [identity profile] perlmonger.livejournal.com
I'm not quite anal enough to benchmark it properly (though a few quick checks on a 2167462 row table showed no significant difference), but I'd have said that in theory "count(*)" gives the DBMS a pretty strong hint that the client isn't interested in table content, so if anything it should be optimised better.

(no subject)

Date: 2006-01-19 12:29 pm (UTC)
From: [identity profile] spride.livejournal.com
that reminds me of the Oracle developer I once met that used the ROWID column as a metric of table size...ie SELECT MAX (ROWID) FROM foo = number of rows in foo.

(no subject)

Date: 2006-01-19 12:31 pm (UTC)
ext_17706: (Default)
From: [identity profile] perlmonger.livejournal.com
well, I suppose it establishes an upper bound... :)

Profile

ramtops: (Default)
ramtops

March 2016

S M T W T F S
  1 2345
6789101112
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags