Hi, > SELECT * > FROM (SELECT * FROM suggest_index ORDER BY query_count) > WHERE query LIKE 'f%' > LIMIT 10 > > For queries where the LIKE clause only returns a small number of hits > this is actually a bit faster than my original query. If the LIKE > clause matches a lot of rows (like it would in this concrete example) > the performance really takes a hit - unsurprisingly.
True. Currently H2 doesn't really take the actual data into account, it only uses the selectivity of a column, but for this you need to run ANALYZE. If the 'analyze' statement would generate a histogram, the optimizer could better calculate the cost. But for this the index mechanism should be changed. Regards, Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. 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 -~----------~----~----~----~------~----~------~--~---
