diff options
| author | Tom Lane | 2003-08-22 20:34:33 +0000 |
|---|---|---|
| committer | Tom Lane | 2003-08-22 20:34:33 +0000 |
| commit | 29a43f398afdbc8372452010b330f242d9ff298d (patch) | |
| tree | 7d5da462ef9de68e362ec5e8936dc25c576f2c32 /src/include | |
| parent | 92ee2528d8bf46739a460e3395057416c53e10d1 (diff) | |
Tweak grammar to use FastAppend rather than lappend when constructing
expr_lists. This appears to be the only remaining O(N^2) bottleneck
in processing many-way 'x IN (a,b,c,...)' conditions.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/pg_list.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index 4d9ce8304b1..8ab22560ce6 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_list.h,v 1.40 2003/08/08 21:42:48 momjian Exp $ + * $Id: pg_list.h,v 1.41 2003/08/22 20:34:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -132,6 +132,9 @@ typedef struct List * FastList is an optimization for building large lists. The conventional * way to build a list is repeated lappend() operations, but that is O(N^2) * in the number of list items, which gets tedious for large lists. + * + * Note: there are some hacks in gram.y that rely on the head pointer (the + * value-as-list) being the first field. */ typedef struct FastList { @@ -144,6 +147,9 @@ typedef struct FastList ( (fl)->head = (l), (fl)->tail = llastnode((fl)->head) ) #define FastListValue(fl) ( (fl)->head ) +#define makeFastList1(fl, x1) \ + ( (fl)->head = (fl)->tail = makeList1(x1) ) + /* * function prototypes in nodes/list.c |
