PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/heapam.h"
#include "access/htup_details.h"
#include "access/multixact.h"
#include "access/tableam.h"
#include "access/xact.h"
#include "access/xlog.h"
#include "catalog/catalog.h"
#include "catalog/indexing.h"
#include "catalog/namespace.h"
#include "catalog/pg_am.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_operator.h"
#include "commands/cluster.h"
#include "commands/matview.h"
#include "commands/tablecmds.h"
#include "commands/tablespace.h"
#include "executor/executor.h"
#include "executor/spi.h"
#include "miscadmin.h"
#include "parser/parse_relation.h"
#include "pgstat.h"
#include "rewrite/rewriteHandler.h"
#include "storage/lmgr.h"
#include "storage/smgr.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | DR_transientrel |
Variables | |
static int | matview_maintenance_depth = 0 |
|
static |
Definition at line 929 of file matview.c.
References Assert(), and matview_maintenance_depth.
Referenced by refresh_by_match_merge().
DestReceiver* CreateTransientRelDestReceiver | ( | Oid | transientoid | ) |
Definition at line 435 of file matview.c.
References DestTransientRel, palloc0(), transientrel_destroy(), transientrel_receive(), transientrel_shutdown(), and transientrel_startup().
Referenced by CreateDestReceiver(), and ExecRefreshMatView().
ObjectAddress ExecRefreshMatView | ( | RefreshMatViewStmt * | stmt, |
const char * | queryString, | ||
ParamListInfo | params, | ||
QueryCompletion * | qc | ||
) |
Definition at line 138 of file matview.c.
References AccessExclusiveLock, AccessShareLock, Assert(), AtEOXact_GUC(), CheckTableNotInUse(), CMD_SELECT, CreateTransientRelDestReceiver(), generate_unaccent_rules::dest, elog(), ereport, errcode(), errhint(), errmsg(), ERROR, ExclusiveLock, get_namespace_name(), GetDefaultTablespace(), GetUserIdAndSecContext(), index_close(), index_open(), is_usable_unique_index(), lfirst_oid, linitial_node, list_free(), list_length(), LockRelationOid(), make_new_heap(), matview_maintenance_depth, NewGUCNestLevel(), NoLock, RuleLock::numLocks, ObjectAddressSet, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pgstat_count_heap_insert(), pgstat_count_truncate(), quote_qualified_identifier(), RangeVarCallbackOwnsTable(), RangeVarGetRelidExtended(), RelationData::rd_rel, RelationData::rd_rules, refresh_by_heap_swap(), refresh_by_match_merge(), refresh_matview_datafill(), RelationGetIndexList(), RelationGetNamespace, RelationGetRelationName, RelationIsPopulated, RuleLock::rules, SECURITY_RESTRICTED_OPERATION, SetMatViewPopulatedState(), SetQueryCompletion(), SetUserIdAndSecContext(), stmt, table_close(), and table_open().
Referenced by ProcessUtilitySlow().
Definition at line 863 of file matview.c.
References attnum, i, NIL, RelationData::rd_index, RelationData::rd_rel, and RelationGetIndexPredicate().
Referenced by ExecRefreshMatView(), and refresh_by_match_merge().
|
static |
Definition at line 541 of file matview.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, and initStringInfo().
Referenced by refresh_by_match_merge().
bool MatViewIncrementalMaintenanceIsEnabled | ( | void | ) |
Definition at line 917 of file matview.c.
References matview_maintenance_depth.
Referenced by CheckValidResultRel().
|
static |
Definition at line 923 of file matview.c.
References matview_maintenance_depth.
Referenced by refresh_by_match_merge().
Definition at line 853 of file matview.c.
References finish_heap_swap(), ReadNextMultiXactId(), and RecentXmin.
Referenced by ExecRefreshMatView().
|
static |
Definition at line 584 of file matview.c.
References appendStringInfo(), appendStringInfoString(), Assert(), attnum, BTEqualStrategyNumber, CLAOID, CloseMatViewIncrementalMaintenance(), StringInfoData::data, DatumGetPointer(), elog(), ereport, errcode(), errdetail(), errmsg(), ERROR, generate_operator_clause(), get_namespace_name(), get_opfamily_member(), GETSTRUCT, HeapTupleIsValid, i, index_close(), index_open(), INDEXRELID, initStringInfo(), is_usable_unique_index(), lfirst_oid, list_free(), make_temptable_name_n(), NameStr, NoLock, ObjectIdGetDatum(), OidIsValid, OpenMatViewIncrementalMaintenance(), palloc0(), quote_qualified_identifier(), RelationData::rd_att, RelationData::rd_index, RelationData::rd_indextuple, RelationGetIndexList(), RelationGetNamespace, RelationGetNumberOfAttributes, RelationGetRelationName, ReleaseSysCache(), resetStringInfo(), RowExclusiveLock, SearchSysCache1(), SECURITY_LOCAL_USERID_CHANGE, SECURITY_RESTRICTED_OPERATION, SetUserIdAndSecContext(), SPI_connect(), SPI_exec(), SPI_execute(), SPI_finish(), SPI_getvalue(), SPI_OK_CONNECT, SPI_OK_DELETE, SPI_OK_FINISH, SPI_OK_INSERT, SPI_OK_SELECT, SPI_OK_UTILITY, SPI_processed, SPI_tuptable, SysCacheGetAttrNotNull(), table_close(), table_open(), SPITupleTable::tupdesc, TupleDescAttr, SPITupleTable::vals, and oidvector::values.
Referenced by ExecRefreshMatView().
|
static |
Definition at line 376 of file matview.c.
References AcquireRewriteLocks(), CHECK_FOR_INTERRUPTS, copyObject, CreateQueryDesc(), CURSOR_OPT_PARALLEL_OK, generate_unaccent_rules::dest, elog(), ERROR, EState::es_processed, QueryDesc::estate, ExecutorEnd(), ExecutorFinish(), ExecutorRun(), ExecutorStart(), ForwardScanDirection, FreeQueryDesc(), GetActiveSnapshot(), InvalidSnapshot, linitial, list_length(), pg_plan_query(), plan, PopActiveSnapshot(), PushCopiedSnapshot(), QueryRewrite(), and UpdateActiveSnapshotCommandId().
Referenced by ExecRefreshMatView().
Definition at line 84 of file matview.c.
References Assert(), CatalogTupleUpdate(), CommandCounterIncrement(), elog(), ERROR, GETSTRUCT, heap_freetuple(), HeapTupleIsValid, newstate(), ObjectIdGetDatum(), RelationData::rd_rel, RelationGetRelid, RELOID, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by ExecRefreshMatView(), and intorel_startup().
|
static |
Definition at line 524 of file matview.c.
References pfree().
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 479 of file matview.c.
References DR_transientrel::bistate, DR_transientrel::output_cid, table_tuple_insert(), DR_transientrel::ti_options, and DR_transientrel::transientrel.
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 507 of file matview.c.
References DR_transientrel::bistate, FreeBulkInsertState(), NoLock, table_close(), table_finish_bulk_insert(), DR_transientrel::ti_options, and DR_transientrel::transientrel.
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 453 of file matview.c.
References Assert(), DR_transientrel::bistate, GetBulkInsertState(), GetCurrentCommandId(), InvalidBlockNumber, NoLock, DR_transientrel::output_cid, RelationGetTargetBlock, TABLE_INSERT_FROZEN, TABLE_INSERT_SKIP_FSM, table_open(), DR_transientrel::ti_options, DR_transientrel::transientoid, and DR_transientrel::transientrel.
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 61 of file matview.c.
Referenced by CloseMatViewIncrementalMaintenance(), ExecRefreshMatView(), MatViewIncrementalMaintenanceIsEnabled(), and OpenMatViewIncrementalMaintenance().