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?  Is the
partial-index used under those circumstances?

--
Tim Romano






On Thu, Aug 19, 2010 at 9:16 PM, Igor Tandetnik <itandet...@mvps.org> wrote:

> Tim Romano <tim.romano...@gmail.com> wrote:
> > How would you find a row whose column X contained value Y if the
> "partial"
> > index on column X specified that rows containing value Y in column X
> should
> > never be returned?
>
> No one suggests partial index should be capable of hiding anything. The
> idea is that, when the query can be proven to only involve rows covered by
> the partial index, the index can be used to speed up the query. Otherwise,
> it simply won't be used.
> --
> Igor Tandetnik
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to