PostgreSQL Study Flashcards
Advanced open-source object-relational database system emphasizing extensibility and standards compliance. Click any card to flip and test your knowledge.
What is MVCC in PostgreSQL?
Multi-Version Concurrency Control (MVCC) ensures data consistency by granting each transaction a snapshot of the database, allowing concurrent reads and writes without locking.
What is the purpose of the Write-Ahead Log (WAL)?
WAL records changes to disk before data pages are updated, ensuring durability and enabling point-in-time recovery (PITR) and replication.
How does JSONB differ from standard JSON in Postgres?
JSONB stores data in a parsed binary format that supports indexing (GIN/GiST) and faster processing, whereas JSON stores exact unparsed text.
What does the EXPLAIN ANALYZE statement do?
EXPLAIN ANALYZE executes the query and provides the exact execution plan along with real execution time and row count statistics.
What is the function of autovacuum?
Autovacuum reclaims dead tuple storage left behind by UPDATEs and DELETEs, and updates planner statistics to maintain performance.
What is a GIN Index used for in Postgres?
Generalized Inverted Index (GIN) is designed for composite items like JSONB documents, arrays, and full-text search documents.
What is the RETURNING clause in INSERT/UPDATE/DELETE?
RETURNING allows DML statements to return modified or inserted row columns directly without issuing a separate SELECT query.
What is a Foreign Data Wrapper (FDW)?
FDW allows PostgreSQL to query external datasets (like Remote Postgres, MySQL, Redis, or CSVs) as if they were local tables.
What is PG Vector used for?
pgvector is an open-source vector similarity search extension for storing and searching high-dimensional AI vector embeddings in Postgres.
How does STRING_AGG work in Postgres?
STRING_AGG concatenates non-null text values from a set of rows into a single string separated by a specified delimiter.
Need practical SQL queries for PostgreSQL?
Explore our ready-to-use copy-paste query recipes in the Cookbook.