|
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 "catalog/indexing.h"#include "catalog/namespace.h"#include "catalog/pg_am.h"#include "catalog/pg_opclass.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 "pgstat.h"#include "rewrite/rewriteHandler.h"#include "storage/lmgr.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 964 of file matview.c.
References Assert(), and matview_maintenance_depth.
Referenced by refresh_by_match_merge().
| DestReceiver * CreateTransientRelDestReceiver | ( | Oid | transientoid | ) |
Definition at line 464 of file matview.c.
References DestTransientRel, _DestReceiver::mydest, palloc0(), DR_transientrel::pub, _DestReceiver::rDestroy, _DestReceiver::receiveSlot, _DestReceiver::rShutdown, _DestReceiver::rStartup, DR_transientrel::transientoid, transientrel_destroy(), transientrel_receive(), transientrel_shutdown(), and transientrel_startup().
Referenced by CreateDestReceiver(), and RefreshMatViewByOid().
| ObjectAddress ExecRefreshMatView | ( | RefreshMatViewStmt * | stmt, |
| const char * | queryString, | ||
| QueryCompletion * | qc | ||
| ) |
Definition at line 120 of file matview.c.
References AccessExclusiveLock, ExclusiveLock, RangeVarCallbackMaintainsTable(), RangeVarGetRelidExtended(), RefreshMatViewByOid(), and stmt.
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 903 of file matview.c.
References attnum, i, NIL, RelationData::rd_index, and RelationGetIndexPredicate().
Referenced by refresh_by_match_merge(), and RefreshMatViewByOid().
| bool MatViewIncrementalMaintenanceIsEnabled | ( | void | ) |
Definition at line 952 of file matview.c.
References matview_maintenance_depth.
Referenced by CheckValidResultRel().
|
static |
Definition at line 958 of file matview.c.
References matview_maintenance_depth.
Referenced by refresh_by_match_merge().
Definition at line 893 of file matview.c.
References finish_heap_swap(), ReadNextMultiXactId(), and RecentXmin.
Referenced by RefreshMatViewByOid().
|
static |
Definition at line 591 of file matview.c.
References appendStringInfo(), appendStringInfoString(), attnum, CloseMatViewIncrementalMaintenance(), COMPARE_EQ, StringInfoData::data, DatumGetPointer(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, generate_operator_clause(), get_namespace_name(), get_opfamily_member_for_cmptype(), GETSTRUCT(), HeapTupleIsValid, i, index_close(), index_open(), initStringInfo(), is_usable_unique_index(), lfirst_oid, list_free(), NameStr, NoLock, ObjectIdGetDatum(), OidIsValid, OpenMatViewIncrementalMaintenance(), palloc0(), psprintf(), 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_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 RefreshMatViewByOid().
|
static |
Definition at line 404 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 RefreshMatViewByOid().
| ObjectAddress RefreshMatViewByOid | ( | Oid | matviewOid, |
| bool | is_create, | ||
| bool | skipData, | ||
| bool | concurrent, | ||
| const char * | queryString, | ||
| QueryCompletion * | qc | ||
| ) |
Definition at line 164 of file matview.c.
References AccessExclusiveLock, AccessShareLock, Assert(), AtEOXact_GUC(), CheckRelationOidLockedByMe(), 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(), 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(), RelationData::rd_rel, RelationData::rd_rules, refresh_by_heap_swap(), refresh_by_match_merge(), refresh_matview_datafill(), RelationGetIndexList(), RelationGetNamespace, RelationGetRelationName, RelationIsPopulated, RestrictSearchPath(), RuleLock::rules, SECURITY_RESTRICTED_OPERATION, SetMatViewPopulatedState(), SetQueryCompletion(), SetUserIdAndSecContext(), table_close(), and table_open().
Referenced by ExecCreateTableAs(), and ExecRefreshMatView().
| void SetMatViewPopulatedState | ( | Relation | relation, |
| bool | newstate | ||
| ) |
Definition at line 78 of file matview.c.
References Assert(), CatalogTupleUpdate(), CommandCounterIncrement(), elog, ERROR, GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, newstate(), ObjectIdGetDatum(), RelationData::rd_rel, RelationGetRelid, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by intorel_startup(), and RefreshMatViewByOid().
|
static |
Definition at line 553 of file matview.c.
References pfree().
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 508 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 536 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 482 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 56 of file matview.c.
Referenced by CloseMatViewIncrementalMaintenance(), MatViewIncrementalMaintenanceIsEnabled(), OpenMatViewIncrementalMaintenance(), and RefreshMatViewByOid().