JDBC counts don't match
I'm using a JDBC driver to connect PGSQL -> Cache. I'm noticing when I run SELECT queries and COUNT(*) command against the same table, I get different result sets. I'm pretty new to Cache in general - so I'm trying to understand why these would be different.
Examples (TransID and InvNum should occur in every "row"):
SELECT COUNT(*) FROM ACCT.Services = 1,090,324 WHERE ACCT.Dept = 483
SELECT TransID FROM ACCT.Services = 1,085,776 WHERE ACCT.Dept = 483
SELECT InvNum FROM ACCT.Services = 586,023 WHERE ACCT.Dept = 483
(I tried the same thing in MSSQL via LinkedServer and it unsurprisingly yielded the same result.)
I'm suspecting this has to do with indexes, possibly? The only reason I say this is because the TransID seems to be the main index on this table. Does the index only include 'active rows' entries? Appreciate any insights. Thanks.