- Sebastian Flyte
- Jun 27, 2003
-
Golly
|
I get some really weird counts with some simple queries (on a MS SQL server 2000):
code:select count(*) from message
-----------
2318728
select count(*) from message where messageIsRead = 0
-----------
7745733
select messageIsRead, count(*) from message group by messageIsRead
messageIsRead
------------- -----------
0 6718298
1 51088
0 228957
1 25544
0 175248
1 51088
0 623230
1 25544
messageIsRead is a bit column, which apparently has four different types of 1s and 0s. And the number of unread messages is more than 5 million higher than the total message count.
What the gently caress is happening here?
Edit: It turned out the indexes were seriously wonky. Rebuilding them got everything back to normal.
Sebastian Flyte fucked around with this message at 18:31 on Jan 9, 2008
|
#
¿
Jan 9, 2008 11:41
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 4, 2024 01:45
|
|