mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Reimplement the linked list data structure used throughout the backend.
In the past, we used a 'Lispy' linked list implementation: a "list" was merely a pointer to the head node of the list. The problem with that design is that it makes lappend() and length() linear time. This patch fixes that problem (and others) by maintaining a count of the list length and a pointer to the tail node along with each head node pointer. A "list" is now a pointer to a structure containing some meta-data about the list; the head and tail pointers in that structure refer to ListCell structures that maintain the actual linked list of nodes. The function names of the list API have also been changed to, I hope, be more logically consistent. By default, the old function names are still available; they will be disabled-by-default once the rest of the tree has been updated to use the new API names.
This commit is contained in:
src
backend
access
bootstrap
catalog
commands
aggregatecmds.calter.canalyze.casync.ccluster.ccomment.ccopy.cdbcommands.cdefine.cexplain.cfunctioncmds.cindexcmds.clockcmds.copclasscmds.coperatorcmds.cportalcmds.cprepare.cschemacmds.csequence.ctablecmds.ctrigger.ctypecmds.cuser.cvacuum.cvariable.cview.c
executor
execAmi.cexecJunk.cexecMain.cexecProcnode.cexecQual.cexecScan.cexecTuples.cexecUtils.cfunctions.cnodeAgg.cnodeAppend.cnodeFunctionscan.cnodeHash.cnodeHashjoin.cnodeIndexscan.cnodeMergejoin.cnodeSubplan.cnodeTidscan.cspi.c
libpq
nodes
optimizer
geqo
path
plan
prep
util
parser
analyze.cgram.yparse_agg.cparse_clause.cparse_coerce.cparse_expr.cparse_func.cparse_node.cparse_relation.cparse_target.cparse_type.c
rewrite
tcop
utils
include
pl
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.112 2004/02/21 00:34:53 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.113 2004/05/26 04:41:39 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1623,7 +1623,7 @@ textToQualifiedNameList(text *textval, const char *caller)
|
||||
char *rawname;
|
||||
List *result = NIL;
|
||||
List *namelist;
|
||||
List *l;
|
||||
ListCell *l;
|
||||
|
||||
/* Convert to C string (handles possible detoasting). */
|
||||
/* Note we rely on being able to modify rawname below. */
|
||||
|
Reference in New Issue
Block a user