On Fri, Aug 20, 2010 at 1:47 PM, Tim Romano <tim.romano...@gmail.com> wrote: > Igor, > Here's the example where a partial index can "hide" rows. > > From the wikipedia article cited by the OP: > > <wikipedia> > It is not necessary that the condition be the same as the index criterion; > Stonebraker's paper below presents a number of examples with indexes similar > to the following: > > create index partial_salary on employee(age) where salary > 2100; > > </wikipedia> > > What would happen if you issued these queries? > > select max(age) from employee > select avg(age) from employee > > Would the ages of employees earning <= 2100 be included?
Yes > Is the partial-index used under those circumstances? No, it would change outcome of the query. The partial index is used only for optimizing queries that satisfy the index condition. F. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users