On Thu, Apr 3, 2014 at 4:35 PM, Steve McLeod <[email protected]> wrote:

> Or can you add a 'IS_OPINION' boolean column that is populated when you
> create the table or insert into the table?
>
> then with an index on that column you'd have extremely fast performance
> with SELECT COUNT(*) FROM PUBLIC.OPINION WHERE NOT IS_OPINION
>

IMHO adding redundancy because of this is no good idea. A DB could be smart
enough to transform

SELECT COUNT(*) FROM PUBLIC.OPINION WHERE CLASSNAME NOT LIKE 'opinion%'

into the difference

SELECT COUNT(*) FROM PUBLIC.OPINION
-
SELECT COUNT(*) FROM PUBLIC.OPINION WHERE CLASSNAME LIKE 'opinion%'

but the user could do it as well. I guess you may need some special
handling in case the column can be NULL.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to