From: | "Mayers, Philip J" <p(dot)mayers(at)ic(dot)ac(dot)uk> |
---|---|
To: | "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: MACADDR types NULL value (undocumented?) |
Date: | 2001-03-26 14:56:05 |
Message-ID: | A0F836836670D41183A800508BAF190B35E47C@icex1.cc.ic.ac.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I was under the impression that indices aren't used for "IS NULL" - I will
need to be scanning for these moderately frequently (but less frequently
than the others). In actual fact, it would be better (from an architectural
point of view) for me for them to be NULL.
Regards,
Phil
+----------------------------------+
| Phil Mayers, Network Support |
| Centre for Computing Services |
| Imperial College |
+----------------------------------+
-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: 26 March 2001 15:45
To: Mayers, Philip J
Cc: 'Michael Fork'; 'pgsql-general(at)postgresql(dot)org'
Subject: Re: [GENERAL] MACADDR types NULL value (undocumented?)
"Mayers, Philip J" <p(dot)mayers(at)ic(dot)ac(dot)uk> writes:
> Oops, yes, you're quite correct: There are some 17700 entries in the
table,
> with 1793 being 00:00:00:00:00:00 - and that warrants a sequential scan,
> you're correct. Damn :o)
If these all-zero entries (a) are really dummy values ("don't know" or
"not applicable"), and (b) outnumber any specific real entry, then it
would be worth your while to replace them with NULLs. The statistics
stuff accounts for NULLs separately from not-nulls, so after a vacuum
analyze you'd find the planner more able to make an intelligent choice
about seq vs index scan on this table.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-03-26 15:05:14 | Re: MACADDR types NULL value (undocumented?) |
Previous Message | Tom Lane | 2001-03-26 14:45:27 | Re: MACADDR types NULL value (undocumented?) |