1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Replace functional-index facility with expressional indexes. Any column

of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
This commit is contained in:
Tom Lane
2003-05-28 16:04:02 +00:00
parent e5f19598e0
commit fc8d970cbc
50 changed files with 1351 additions and 1283 deletions

View File

@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.254 2003/05/27 17:49:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.255 2003/05/28 16:03:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -304,7 +304,7 @@ vacuum(VacuumStmt *vacstmt)
if (vacstmt->vacuum)
{
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
SetQuerySnapshot(); /* might be needed for functions in indexes */
}
else
old_context = MemoryContextSwitchTo(anl_context);
@ -728,7 +728,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
/* Begin a transaction for vacuuming this relation */
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
SetQuerySnapshot(); /* might be needed for functions in indexes */
/*
* Check for user-requested abort. Note we want this to be inside a
@ -3028,7 +3028,10 @@ vac_is_partial_index(Relation indrel)
return true;
/* Otherwise, look to see if there's a partial-index predicate */
return (VARSIZE(&indrel->rd_index->indpred) > VARHDRSZ);
if (!heap_attisnull(indrel->rd_indextuple, Anum_pg_index_indpred))
return true;
return false;
}