PostgreSQL Associate Database Maintenance Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 14 | Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. What is the primary purpose of the VACUUM command?

Explanation

VACUUM cleans up dead tuples left behind by updates and deletes, helping reclaim storage and maintain database performance. It also updates visibility information so PostgreSQL can manage table data more efficiently.

Submit
Please wait...
About This Quiz
PostgreSQL Associate Database Maintenance Quiz - Quiz

This quiz evaluates your knowledge of PostgreSQL database maintenance, covering essential operations like backups, recovery, performance tuning, and administrative tasks. Designed for college-level learners preparing for PostgreSQL Associate certification, it tests practical skills needed to maintain production databases effectively and ensure data integrity and system reliability.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. What does maintenance_work_mem control?

Explanation

`maintenance_work_mem` sets the amount of memory available to individual maintenance operations, such as `VACUUM` and `CREATE INDEX`. It is not a total limit for all maintenance tasks or a general query cache; multiple operations may each use memory up to this setting.

Submit

3. What is the purpose of CLUSTER in PostgreSQL?

Explanation

CLUSTER rewrites a PostgreSQL table so its rows are stored in the order of a specified index. This can improve performance for queries that access nearby index values, though the ordering is not automatically maintained as rows are inserted or updated.

Submit

4. Which archive method stores WAL files for point-in-time recovery?

Explanation

PostgreSQL’s `archive_command` setting specifies the command used to copy completed WAL segment files to a safe archive location. Combined with WAL archiving enabled, these files can be replayed alongside a base backup to restore the database to a chosen point in time.

Submit

5. What does the effective_cache_size parameter do?

Explanation

`effective_cache_size` is a planner estimate of the disk cache available to a query, including PostgreSQL buffers and operating-system cache. It helps the planner choose between options such as index scans and sequential scans. It does not reserve memory or control the size of PostgreSQL’s buffer pool.

Submit

6. Which command removes unused indexes from a table?

Explanation

Unused indexes are not generally removed automatically by a universal command. They must first be identified using database usage statistics or query monitoring, then removed explicitly with `DROP INDEX` after confirming they are safe to remove. `VACUUM ANALYZE` and `OPTIMIZE TABLE` maintain or optimize storage and statistics; they do not selectively delete unused indexes.

Submit

7. What is the primary function of autovacuum?

Explanation

Autovacuum periodically checks database tables and runs VACUUM to clean up obsolete row versions and help reclaim space. It also runs ANALYZE to refresh table statistics used by the query planner, reducing the need to perform these maintenance tasks manually.

Submit

8. What does the shared_buffers parameter control?

Explanation

In PostgreSQL, `shared_buffers` sets the portion of memory the server uses to cache database pages. Frequently accessed data can be read from this shared cache instead of repeatedly fetched from disk, helping improve query performance. It does not configure network buffers, temporary-file limits, or connection-pool size.

Submit

9. What is the purpose of pg_basebackup?

Explanation

pg_basebackup is a PostgreSQL utility that copies a database cluster’s physical files from a running server using the replication protocol. The resulting base backup can initialize a standby server or support physical recovery. It does not create incremental backups, export query results as CSV, or validate database integrity.

Submit

10. Which parameter sets the amount of memory used for sorting operations?

Explanation

`work_mem` sets the amount of memory PostgreSQL can use for an individual sorting operation before it spills data to temporary files on disk. It can also be used for other operations, such as hash joins. The memory limit applies per operation, so multiple concurrent queries can use substantially more memory overall.

Submit

11. What does REINDEX do?

Explanation

REINDEX rebuilds an existing index from scratch using the table’s current data. This can help repair a corrupted index or reclaim space, while preserving the index definition and its associated constraints.

Submit

12. Which view shows current active connections and their queries?

Explanation

`pg_stat_activity` is PostgreSQL’s built-in system view for monitoring server processes and database sessions. It provides details such as connection state and, when available, the query each session is running. This makes it useful for checking current connections and identifying active queries.

Submit

13. What is write-ahead logging (WAL) primarily used for?

Explanation

Write-ahead logging records database changes in a log before those changes are applied to the main data files. If the system crashes, the database can use the log to recover committed changes and restore a consistent state, helping ensure durability and reliable recovery.

Submit

14. What does ANALYZE do in PostgreSQL?

Explanation

ANALYZE samples table data and updates statistics in PostgreSQL’s system catalogs, such as estimates of row counts and value distributions. The query planner uses these statistics to estimate the cost of different strategies and choose efficient execution plans. ANALYZE does not repair indexes, remove columns, or check SQL syntax.

Submit

15. Which parameter controls the maximum number of connections allowed in PostgreSQL?

Explanation

`max_connections` is the PostgreSQL configuration parameter that sets the maximum number of concurrent client connections the server will accept. Increasing it may require additional memory and system resources.

Submit

16. Which command is used to create a logical backup of a PostgreSQL database?

Explanation

`pg_dump` creates a logical backup by exporting a PostgreSQL database’s schema and data into a dump file. The backup can later be used to restore the database, often with `pg_restore` or `psql`, depending on the dump format.

Submit

17. Which command checks for and repairs table corruption?

Explanation

VACUUM FULL rewrites a table into a new file, reclaiming unused space and rebuilding its physical layout. This rewrite can help resolve some table-level corruption encountered during processing. Unlike ANALYZE, which updates statistics, or CLUSTER, which reorders rows, it performs a full rewrite; it requires an exclusive lock and can need substantial disk space.

Submit

18. Which log level records all SQL statements executed?

Explanation

In PostgreSQL, setting `log_statement = 'all'` enables logging of every SQL statement received by the server, including statements such as queries and data-definition commands. This setting provides comprehensive statement-level logging, though it can generate large log files and may record sensitive information.

Submit

19. Which tool is used to restore a logical backup created with pg_dump?

Explanation

`pg_dump` can create plain-text SQL files or archive-format backups. Plain SQL dumps are restored by running `psql` with the `-f` flag, while custom, directory, or tar-format dumps are restored with `pg_restore`. Thus, both tools can restore a `pg_dump` backup, depending on the format used.

Submit

20. Which view displays index usage statistics?

Explanation

`pg_stat_user_indexes` reports usage statistics for indexes on user tables, including the number of index scans and tuples read or fetched. This helps identify frequently used or rarely used indexes. `pg_indexes` lists index definitions rather than usage statistics.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is the primary purpose of the VACUUM command?
What does maintenance_work_mem control?
What is the purpose of CLUSTER in PostgreSQL?
Which archive method stores WAL files for point-in-time recovery?
What does the effective_cache_size parameter do?
Which command removes unused indexes from a table?
What is the primary function of autovacuum?
What does the shared_buffers parameter control?
What is the purpose of pg_basebackup?
Which parameter sets the amount of memory used for sorting operations?
What does REINDEX do?
Which view shows current active connections and their queries?
What is write-ahead logging (WAL) primarily used for?
What does ANALYZE do in PostgreSQL?
Which parameter controls the maximum number of connections allowed in...
Which command is used to create a logical backup of a PostgreSQL...
Which command checks for and repairs table corruption?
Which log level records all SQL statements executed?
Which tool is used to restore a logical backup created with pg_dump?
Which view displays index usage statistics?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!