On Thu, Jun 8, 2017 at 11:05 AM, Jeremy Finzel wrote:
> On Thu, Jun 8, 2017 at 9:58 AM, Tom Lane wrote:
>> Merlin Moncure writes:
>> > Having said that, what I typically do in such
>> > cases (this comes a lot in database driven work queues) something like
>> > this:
>> > CREATE INDEX ON table (
Normally, I find that in these situations, it makes sense to index the
primary key of the table WHERE col is not null, because it will usually
cover the largest number of cases, and is much better than a two-value
boolean index, for example.
On Thu, Jun 8, 2017 at 9:58 AM, Tom Lane wrote:
> Merl
On Mon, Jun 05, 2017 at 05:02:32PM -0400, Tom Lane wrote:
> Justin Pryzby writes:
> > diff --git a/src/backend/utils/adt/selfuncs.c
> > b/src/backend/utils/adt/selfuncs.c
> > + if (nd1>vardata1->rel->rows) nd1=vardata1->rel->rows;
> > + if (nd2>vardata1->rel->rows) nd2=vardata2->rel->
Merlin Moncure writes:
> On Mon, May 22, 2017 at 10:17 AM, Ariel wrote:
>> Should I do:
>>
>> CREATE INDEX ON table ((col IS NOT NULL)) WHERE col IS NOT NULL
>>
>> or:
>>
>> CREATE INDEX ON table (col) WHERE col IS NOT NULL
>>
>> I'm thinking the first index will make a smaller, simpler, inde
On Mon, May 22, 2017 at 10:17 AM, Ariel wrote:
>
> I need to be able to quickly find rows where a column is not null (only a
> small percent of the rows will have that column not null).
>
> Should I do:
>
> CREATE INDEX ON table ((col IS NOT NULL)) WHERE col IS NOT NULL
>
> or:
>
> CREATE INDEX ON