Re: Planning a change of representation in the planner - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planning a change of representation in the planner
Date
Msg-id 26603.1044628875@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planning a change of representation in the planner  (Hannu Krosing <hannu@tm.ee>)
List pgsql-hackers
Hannu Krosing <hannu@tm.ee> writes:
> Maybe the quicker way to avoid duplicate-element bugs (and get faster
> merges) is to keep the lists ordered, so instead of just appending the
> next int, you scan to the proper place and put it there (if it is not
> there already).

I had thought of doing that before it occurred to me to switch to a
bitmap representation, but I was always afraid to --- I think it would
be more buggy not less so.  The compiler won't give any help in catching
places where plain-list operations are applied to what should be an
ordered list.  If I change the struct type completely, then the compiler
will help me.

Also, the bitmap representation makes for a nice reduction in palloc()
traffic (typically one palloc per set, not one per set element).  That
part of the performance gain won't be there if we just change to ordered
lists.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martin Marques
Date:
Subject: Incremental backup
Next
From: Teodor Sigaev
Date:
Subject: Re: Alpha version of contrib/tsearch is available for testing