Thomas, I tried SHUTDOWN DEFRAG and still get similar results. Here is the selectivity now, and I just ran ANALYZE:
SELECT COLUMN_NAME,DATA_TYPE,SELECTIVITY FROM information_schema.columns WHERE LOWER(TABLE_SCHEMA) = 'public' AND LOWER(TABLE_NAME) LIKE 'om' *COLUMN_NAME**DATA_TYPE**SELECTIVITY*1'OMATTRIBID'412'OBJID'-553'OWNERID'414 'OBJVALUE'12125'LISTORDER'416'OMID'-5100 These are what I expect them to be. To answer your question, I would expect it to choose the OM_ATTRVAL_ID (on OMATTRIBID, OBJVALUE) index, or would you expect it would be faster (because of the OR/IN component) to create a new index on only OMATTRIBID? I tried that and explain gave the same output. If I just run: SELECT * FROM om WHERE objvalue='468203' it takes a few ms to run. And: SELECT * FROM om WHERE OMATTRIBID=26 AND objvalue='468203' takes just a few ms also. But if I just run: SELECT * FROM om WHERE OMATTRIBID IN (26,27) it takes about 30-60 seconds So it seems like OR/IN has some issue.. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/nqBpWf_DDFwJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
