On 10.10.2010 05:26, Tom Lane wrote:
> Try it like
>
> WHERE amazon_product_id IS NOT NULL;
>
You are right. When I change the condition on the index like this, the
index gets used as it should. Even without having to specify the extra
not null condition in the query.
> We don't expend an infinite number of cycles on rewriting different
> query formulations into each other, and that's one of the ones we
> don't handle ...
>
The problem is the code is generated by an ORM and so cannot easily be
modified. I can understand that you wont spend the time for each query,
but I think for (normally) very seldom used things like creating new
indices it would be a good enhancement.
Corin