updated list rewrite

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: updated list rewrite
Date: 2004-05-24 10:56:34
Message-ID: 40B1D4E2.7030603@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

I've attached a new version of the list rewrite patch (gzip'ed). Changes
since the last patch:

- incorporate two bugfixes from Tom: off-by-one in list_nth() and
replace another lfirst() in optimizer/plan/createplan.c with

- reimplement list_difference() and list_union(); rather than trying to
provide one function that works for all kinds of lists, give up on
trying to reuse code and provide datatype specific functions. This means
we don't need list_append_auto() and list_member_auto(). Along the way,
fix a bug in list_difference() pointed out by Tom.

- replace list_head(), list_tail() and list_length() macros with GCC
inline functions, when possible (otherwise, we fall back to out-of-line
functions). This avoids doubly-evaluating the macro arguments, but it
will likely result in a performance hit for non-GCC compilers. Since
inline functions are specified by C99, we shouldn't assume that CC !=
gcc implies inline functions aren't available, but I'll revisit this later.

- add linitial(), linitial_int(), and linitial_oid(). I haven't actually
changed the tree to use these macros yet, though.

- add a new #define LIST_CELL_TYPE in pg_list.h to reduce the number of
list compatibility #ifdefs


Attachment Content-Type Size
partial-list-rewrite-75.patch.gz application/x-gzip 62.4 KB


Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-05-24 13:43:42 Re: Tuple sampling
Previous Message Manfred Koizar 2004-05-24 10:29:27 Re: Tuple sampling