pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedCreste Index with nullable
2+ messages / 2 participants
[nested] [flat]
* Creste Index with nullable
@ 2006-01-17 13:10 Diego <diego@unimedijui.com.br>
0 siblings, 1 reply; 2+ messages in thread
From: Diego @ 2006-01-17 13:10 UTC (permalink / raw)
To: pgsql-admin
Hi,
I have a question!
create table test (
code int not null,
name varchar(40) not null,
last_name varchar(40) {this field is nullable}
)
I can create a index like
"CREATE INDEX idx_test ON etqmov USING btree (name, last_name)"
using a nullable field? Will work fine?
Thanks...
Diego Ziquinatti
From Brazil
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Creste Index with nullable
@ 2006-01-17 15:20 Tom Lane <tgl@sss.pgh.pa.us>
parent: Diego <diego@unimedijui.com.br>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2006-01-17 15:20 UTC (permalink / raw)
To: Diego <diego@unimedijui.com.br>; +Cc: pgsql-admin
Diego <diego@unimedijui.com.br> writes:
> I can create a index like
> "CREATE INDEX idx_test ON etqmov USING btree (name, last_name)"
> using a nullable field? Will work fine?
Sure. Note however that "last_name IS NULL" is not an indexable
operation, so you won't be able to use the index to search for rows
containing nulls. This may or may not matter to you, but if it does
you'll need to think of another way to locate those rows. (Some people
solve this sort of problem with partial indexes.)
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-01-17 15:20 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17 13:10 Creste Index with nullable Diego <diego@unimedijui.com.br>
2006-01-17 15:20 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox