Well, you're obviously right - I didn't know this. I guess I've found
that the index is not used for null values, and deduced somehow that
NULL values are not stored in the index.
Thanks, it's nice to find out a 'bug' before it's too late :-)
regards
Tomas
Are you sure NULL values are not sto
On Tue, 11 Nov 2008, Tom Lane wrote:
Index is not used for
is null
How to fix ?
Update to something newer than 8.1 (specifically, you'll need 8.3).
Oooh, that's useful to know. We can get rid of all our extra nulls
indexes. Thanks.
Matthew
--
As you approach the airport, you see a sign s
On Tue, Nov 11, 2008 at 4:00 PM, Vladimir Sitnikov
<[EMAIL PROTECTED]> wrote:
>
>> Yes, NULL values are not stored in the index, but you may create
>> functional index on
>
> Are you sure NULL values are not stored? btree, gist and bitmap index and
> search for NULL values.
It's not that they're n
> Yes, NULL values are not stored in the index, but you may create functional
> index on
>
Are you sure NULL values are not stored? btree, gist and bitmap index and
search for NULL values.
select amname, amindexnulls, amsearchnulls from pg_am;
amname | amindexnulls | amsearchnulls
+-
Index is not used for
is null
condition:
create index makse_dokumnr_idx on makse(dokumnr);
explain select
sum( summa)
from MAKSE
where dokumnr is null
"Aggregate (cost=131927.95..131927.96 rows=1 width=10)"
" -> Seq Scan on makse (cost=0.00..131927.94 rows=1 width=10)"
"F
Tom Lane <[EMAIL PROTECTED]> schrieb:
> "Andrus" <[EMAIL PROTECTED]> writes:
> > Index is not used for
> > is null
>
> > How to fix ?
>
> Update to something newer than 8.1 (specifically, you'll need 8.3).
Right. For my example in the other mail:
test=*# create index idx_foo on foo(i);
CREATE
Andrus <[EMAIL PROTECTED]> schrieb:
> Index is not used for
>
> is null
>
> condition:
>
> create index makse_dokumnr_idx on makse(dokumnr);
> explain select
> sum( summa)
> from MAKSE
> where dokumnr is null
>
> "Aggregate (cost=131927.95..131927.96 rows=1 width=10)"
> " -> Seq Scan
"Andrus" <[EMAIL PROTECTED]> writes:
> Index is not used for
> is null
> How to fix ?
Update to something newer than 8.1 (specifically, you'll need 8.3).
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to
Index is not used for
is null
condition:
create index makse_dokumnr_idx on makse(dokumnr);
explain select
sum( summa)
from MAKSE
where dokumnr is null
"Aggregate (cost=131927.95..131927.96 rows=1 width=10)"
" -> Seq Scan on makse (cost=0.00..131927.94 rows=1 width=10)"
"F