Re: null values / partial indices - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: null values / partial indices
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961EEE@m0114.s-mxs.net
Whole thread Raw
In response to null values / partial indices  ("Mario Weilguni" <mario.weilguni@icomedias.com>)
List pgsql-hackers
> mydb=# create index str_idx_url on str(url) where url is not null;
> CREATE
> mydb=# analyze str;
> ANALYZE
> mydb=# EXPLAIN ANALYZE select id from str where url='foobar';
> NOTICE:  QUERY PLAN:
>
> Seq Scan on str  (cost=0.00..91.05 rows=3 width=4) (actual

You can try an index like:
create index str_idx_url on str(url) where url >= '';

I think that should be identical. ('' is the smallest string, no ?)

Andreas


pgsql-hackers by date:

Previous
From: "Mario Weilguni"
Date:
Subject: null values / partial indices
Next
From: "Mario Weilguni"
Date:
Subject: Re: null values / partial indices