Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
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 
lfirst(list_head())

- 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

-Neil


Attachment: partial-list-rewrite-75.patch.gz
Description: application/x-gzip (62.4 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2004-05-24 13:43:42
Subject: Re: Tuple sampling
Previous:From: Manfred KoizarDate: 2004-05-24 10:29:27
Subject: Re: Tuple sampling

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group