You created an index each on 'x' and 'y'. is create index on T(x) and create index on T(y) ;
or create index on T(x,y) ? Because in first example, h2 will only use one index, not both of them. 在 2015年3月19日星期四 UTC+8下午12:36:04,Akhil Kodali写道: > > Hi, > > I have a table T (x: BIGINT(19), y: BIGINT(19)) > There are over 25 million rows in the Table > > And I created an index each on 'x' and 'y'. There us no primary key > > When I do > explain analyze select * from T where 123 >= x and 123 <= y > It takes over 5 minutes and shows over 25 Million rows were scanned > And there is a match on only 1 record > > Any pointers how do I improve performance on these kinda range queries ? > > Akhil > -- 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.
