12 November 2020

#Postgresql

Key Concepts


S.NoTopicSub Topic
1 PostgreSQL Architecture Server Architecture, Backend Processes, Shared Buffers, WAL, Background Workers
2 Advanced Data Types UUID, ENUM, ARRAY, Range Types, Composite Types, Custom Types
3 Advanced SQL Complex Queries, Correlated Subqueries, EXISTS, CASE, FILTER
4 Advanced Joins Self Join, Multiple Joins, LATERAL JOIN, Join Algorithms
5 CTE & Recursive Queries WITH, Multiple CTEs, Recursive CTE, CTE Materialization
6 Window Functions ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, Window Frames
7 Advanced Aggregation STRING_AGG, ARRAY_AGG, JSON_AGG, GROUPING SETS, ROLLUP, CUBE
8 Transactions & MVCC MVCC Architecture, Tuple Visibility, Snapshots, Transaction IDs
9 Transaction Isolation Read Committed, Repeatable Read, Serializable, Serialization Failures
10 Locks & Concurrency Row Locks, Table Locks, Advisory Locks, Blocking, Lock Monitoring
11 Deadlocks Deadlock Detection, Prevention, Transaction Ordering, Retry Strategies
12 Indexing Internals B-Tree, Hash, Index Structure, Selectivity, Index Maintenance
13 Advanced Indexing Composite, Partial, Expression, Covering, GIN, GiST, BRIN
14 Query Execution EXPLAIN, EXPLAIN ANALYZE, Execution Plans, Cost Estimation
15 Query Optimization Sequential Scan, Index Scan, Bitmap Scan, Nested Loop, Hash Join, Merge Join
16 Planner & Statistics ANALYZE, Statistics Targets, Cardinality Estimation, Planner Parameters
17 VACUUM & Bloat VACUUM, VACUUM FULL, Autovacuum, Dead Tuples, Table Bloat
18 JSONB Performance JSONB Operators, JSON Path, GIN Indexes, Query Optimization
19 Partitioning Range, List, Hash, Partition Pruning, Partition-wise Joins
20 Large-Scale Data COPY, Bulk Loading, Batch Processing, High-Volume INSERT, Data Migration
21 PL/pgSQL Variables, Control Structures, Loops, Exceptions, Dynamic SQL
22 Functions, Procedures & Triggers Stored Procedures, Functions, Trigger Functions, Audit Triggers
23 Performance Tuning shared_buffers, work_mem, maintenance_work_mem, effective_cache_size
24 Connection Management max_connections, HikariCP, Connection Pooling, Pool Sizing, Timeouts
25 Monitoring & Troubleshooting pg_stat_activity, pg_stat_statements, Locks, Slow Queries, Wait Events
26 Backup & Recovery pg_dump, pg_restore, WAL Archiving, PITR, Recovery Strategies
27 Replication Streaming Replication, WAL Replication, Replication Slots, Replication Lag
28 High Availability Primary/Standby, Read Replicas, Failover, Switchover, Disaster Recovery
29 Enterprise Integration Spring Boot, JPA, JdbcTemplate, Kafka, Spark, CDC
30 Production Architecture Performance, Partitioning, HA, Security, Monitoring, Backup, Scaling, DR

Interview Question



What is PostgreSQL, and what are its key features?
What are the main differences between PostgreSQL and other relational databases?
What is the PostgreSQL architecture?
What is MVCC in PostgreSQL, and how does it work?
What are the different PostgreSQL data types?
What is the difference between VARCHAR, TEXT, and CHAR in PostgreSQL?
What is the difference between SERIAL and IDENTITY columns?
What are schemas in PostgreSQL?
What is the difference between a database and a schema in PostgreSQL?
What are primary keys and foreign keys in PostgreSQL?
What are the different types of constraints in PostgreSQL?
What is a composite key in PostgreSQL?
What is a self join, and when would you use it?
What is the difference between INNER JOIN and LEFT JOIN?
What is a LATERAL JOIN in PostgreSQL?
What is a CROSS JOIN, and when is it useful?
What are Common Table Expressions in PostgreSQL?
What is a recursive CTE, and where is it used?
What are window functions in PostgreSQL?
What is the difference between ROW_NUMBER, RANK, and DENSE_RANK?
How do LAG and LEAD functions work in PostgreSQL?
What are window frames in PostgreSQL?
What is the difference between WHERE and HAVING?
What is the difference between UNION and UNION ALL?
What are GROUPING SETS, ROLLUP, and CUBE?
What is the difference between EXISTS and IN?
What is a correlated subquery?
What is an index in PostgreSQL?
What types of indexes are supported by PostgreSQL?
What is a B-tree index?
What is a GIN index, and when should it be used?
What is a GiST index, and when should it be used?
What is a BRIN index?
What is a composite index?
What is a partial index?
What is an expression index?
What is a covering index in PostgreSQL?
How do you decide which columns should be indexed?
What is index selectivity?
What is EXPLAIN in PostgreSQL?
What is EXPLAIN ANALYZE?
How do you read a PostgreSQL execution plan?
What is a sequential scan?
What is an index scan?
What is a bitmap heap scan?
What is a nested loop join?
What is a hash join?
What is a merge join?
How does the PostgreSQL query planner choose an execution plan?
What are PostgreSQL planner statistics?
What is ANALYZE in PostgreSQL?
What is VACUUM, and why is it required?
What is the difference between VACUUM and VACUUM FULL?
What is autovacuum in PostgreSQL?
What is table bloat in PostgreSQL?
What is transaction isolation in PostgreSQL?
What are the PostgreSQL transaction isolation levels?
What is the difference between Read Committed and Repeatable Read?
What is Serializable isolation in PostgreSQL?
What are locks in PostgreSQL?
What is the difference between row-level and table-level locks?
What are advisory locks in PostgreSQL?
What causes deadlocks in PostgreSQL?
How do you detect and troubleshoot deadlocks in PostgreSQL?
What are transactions and savepoints in PostgreSQL?
What is JSONB in PostgreSQL?
What is the difference between JSON and JSONB?
How do you index JSONB data?
What are JSONB operators in PostgreSQL?
What is JSON path in PostgreSQL?
How are arrays handled in PostgreSQL?
What are PostgreSQL range types?
What are views in PostgreSQL?
What are materialized views in PostgreSQL?
What is the difference between a view and a materialized view?
What are functions in PostgreSQL?
What is PL/pgSQL?
What is the difference between a PostgreSQL function and procedure?
What are triggers in PostgreSQL?
What are BEFORE and AFTER triggers?
What are event triggers in PostgreSQL?
What is table partitioning in PostgreSQL?
What are the different partitioning strategies in PostgreSQL?
What is partition pruning?
When should you use range partitioning?
How do you handle millions or billions of rows in PostgreSQL?
What is the COPY command in PostgreSQL?
How do you perform bulk inserts efficiently in PostgreSQL?
What is connection pooling?
How do you configure HikariCP with PostgreSQL?
What PostgreSQL configuration parameters are important for performance?
What is shared_buffers?
What is work_mem?
What is maintenance_work_mem?
What is effective_cache_size?
How do you troubleshoot a slow PostgreSQL query?
How do you identify blocking queries in PostgreSQL?
What is pg_stat_activity?
What is pg_stat_statements?
How do you monitor PostgreSQL performance?
What are PostgreSQL roles and privileges?
What is Row-Level Security in PostgreSQL?
How do you implement least-privilege security in PostgreSQL?
How do you backup and restore a PostgreSQL database?
What is pg_dump?
What is pg_restore?
What is WAL in PostgreSQL?
What is Point-in-Time Recovery in PostgreSQL?
What is streaming replication in PostgreSQL?
What are replication slots?
What is replication lag?
How do you implement high availability in PostgreSQL?
How do you configure PostgreSQL read replicas?
How do you handle PostgreSQL failover?
How do you integrate PostgreSQL with Spring Boot?
What are the differences between JPA, Hibernate, and JdbcTemplate with PostgreSQL?
How do you optimize PostgreSQL queries from a Spring Boot application?
How do you handle PostgreSQL transactions in Spring Boot?
How do you configure PostgreSQL connection pooling in Spring Boot?
How do you integrate PostgreSQL with Apache Spark?
How do you optimize Spark JDBC reads and writes with PostgreSQL?
How do you implement CDC from PostgreSQL to Kafka?
How would you design a high-performance PostgreSQL database for a financial application?
How would you troubleshoot a PostgreSQL production performance issue?
How would you design PostgreSQL for high availability and disaster recovery?
Why is PostgreSQL preferred for enterprise applications?
Why does PostgreSQL use MVCC?
Why is MVCC important for PostgreSQL concurrency?
Why would you choose PostgreSQL over MySQL?
Why should you use a schema in PostgreSQL?
Why should you use UUID instead of sequential IDs in PostgreSQL?
Why is BIGINT preferred over INTEGER for high-volume tables?
Why should you use NUMERIC for financial calculations?
Why would you use JSONB instead of JSON?
Why should JSONB columns be indexed?
Why would you use a GIN index for JSONB data?
Why would you use a BRIN index instead of a B-tree index?
Why would you use a GiST index?
Why should you create a composite index?
Why does column order matter in a composite index?
Why would you use a partial index?
Why would you use an expression index?
Why can too many indexes reduce database performance?
Why might PostgreSQL ignore an existing index?
Why is index selectivity important?
Why should you use EXPLAIN ANALYZE?
Why might PostgreSQL choose a sequential scan instead of an index scan?
Why is EXPLAIN ANALYZE different from EXPLAIN?
Why does PostgreSQL use different join algorithms?
Why would PostgreSQL choose a nested loop join?
Why would PostgreSQL choose a hash join?
Why would PostgreSQL choose a merge join?
Why are PostgreSQL statistics important for query optimization?
Why should ANALYZE be run after significant data changes?
Why is VACUUM required in PostgreSQL?
Why does PostgreSQL need autovacuum?
Why does table bloat occur in PostgreSQL?
Why should VACUUM FULL be used carefully?
Why are CTEs useful in PostgreSQL?
Why would you use a recursive CTE?
Why would you use window functions instead of GROUP BY?
Why would you use ROW_NUMBER instead of RANK?
Why would you use LAG and LEAD functions?
Why are materialized views useful for reporting?
Why would you use a PostgreSQL function?
Why would you use a stored procedure instead of application logic?
Why would you use triggers in PostgreSQL?
Why should triggers be used carefully?
Why are transactions important in PostgreSQL?
Why are SAVEPOINTs useful?
Why does PostgreSQL provide multiple transaction isolation levels?
Why is Read Committed the default isolation level?
Why would you use Serializable isolation?
Why do serialization failures occur?
Why do deadlocks occur in PostgreSQL?
Why should transactions acquire locks in a consistent order?
Why would you use advisory locks?
Why can long-running transactions cause PostgreSQL performance problems?
Why is connection pooling important for PostgreSQL applications?
Why is HikariCP commonly used with PostgreSQL and Spring Boot?
Why can excessive database connections reduce performance?
Why is shared_buffers important for PostgreSQL performance?
Why is work_mem important for query performance?
Why should work_mem not be configured too aggressively?
Why is effective_cache_size important for the query planner?
Why is partitioning useful for very large PostgreSQL tables?
Why would you choose range partitioning?
Why would you choose list partitioning?
Why would you choose hash partitioning?
Why is partition pruning important?
Why can partitioning improve query performance?
Why should partition keys be selected carefully?
Why is COPY faster than individual INSERT statements?
Why should batch inserts be used for large data loads?
Why is WAL important in PostgreSQL?
Why does PostgreSQL use Write-Ahead Logging?
Why is WAL archiving required for point-in-time recovery?
Why is Point-in-Time Recovery important?
Why would you use streaming replication?
Why can replication lag occur?
Why are replication slots important?
Why can replication slots consume excessive disk space?
Why would you use read replicas?
Why is high availability important for PostgreSQL?
Why is failover required in a PostgreSQL HA architecture?
Why should PostgreSQL backups be tested regularly?
Why would you use pg_dump instead of physical backup?
Why would you use physical backups instead of logical backups?
Why is Row-Level Security useful in PostgreSQL?
Why should PostgreSQL roles follow the principle of least privilege?
Why should SSL/TLS be enabled for PostgreSQL connections?
Why would you use Flyway or Liquibase with PostgreSQL?
Why should database schema changes be version controlled?
Why can JPA-generated SQL cause PostgreSQL performance issues?
Why would you use JdbcTemplate instead of JPA for some PostgreSQL operations?
Why should PostgreSQL connection pools be tuned for Spring Boot applications?
Why would you use native SQL in a Spring Boot PostgreSQL application?
Why should PostgreSQL JDBC batch operations be used for large datasets?
Why would you integrate PostgreSQL with Apache Spark?
Why should Spark JDBC partitioning be configured for large PostgreSQL datasets?
Why would you integrate PostgreSQL with Kafka?
Why is CDC useful for PostgreSQL and Kafka architectures?
Why would PostgreSQL be suitable as a vector database for RAG applications?
Why would you use pgvector with PostgreSQL?
Why is PostgreSQL suitable for high-volume financial applications?
Why should PostgreSQL performance be monitored continuously in production?
Why is pg_stat_statements useful for production troubleshooting?
Why is pg_stat_activity useful for identifying database problems?
Why should blocking queries be monitored in production?
Why should PostgreSQL configuration be tuned according to workload?
Why is database scalability important when designing PostgreSQL systems?
Why should PostgreSQL architecture include disaster recovery planning?
When should you choose PostgreSQL over other relational databases?
When should you use JSONB instead of a normalized relational structure?
When should you use JSON instead of JSONB in PostgreSQL?
When should you use UUID instead of a sequential ID?
When should you use BIGINT instead of INTEGER?
When should you use NUMERIC instead of floating-point types?
When should you create a composite index?
When should you use a partial index?
When should you use an expression index?
When should you use a GIN index?
When should you use a GiST index?
When should you use a BRIN index?
When should you avoid creating an index?
When should PostgreSQL perform a sequential scan instead of an index scan?
When should you use EXPLAIN instead of EXPLAIN ANALYZE?
When should you use EXPLAIN ANALYZE in production?
When should you use a CTE instead of a subquery?
When should you use a recursive CTE?
When should you use a window function instead of GROUP BY?
When should you use LAG and LEAD functions?
When should you use a materialized view?
When should you use a PostgreSQL function?
When should you use a stored procedure?
When should you use a trigger?
When should you use a transaction?
When should you use SAVEPOINT?
When should you use Repeatable Read isolation?
When should you use Serializable isolation?
When should you use an advisory lock?
When should you investigate database locks?
When should you use VACUUM?
When should you use VACUUM FULL?
When should you manually run ANALYZE?
When should you tune autovacuum settings?
When should you partition a PostgreSQL table?
When should you use range partitioning?
When should you use list partitioning?
When should you use hash partitioning?
When should you use the COPY command?
When should you use batch INSERT operations?
When should you use connection pooling?
When should you increase the PostgreSQL connection pool size?
When should you use pg_stat_statements?
When should you use pg_stat_activity for troubleshooting?
When should you use logical backups instead of physical backups?
When should you use Point-in-Time Recovery?
When should you use streaming replication?
When should you use read replicas?
When should you use Row-Level Security?
When should you use PostgreSQL with pgvector for RAG applications?
Where are PostgreSQL configuration files located?
Where is PostgreSQL data physically stored?
Where are PostgreSQL Write-Ahead Log files stored?
Where can you find PostgreSQL server logs?
Where can you check active database connections in PostgreSQL?
Where can you identify long-running queries in PostgreSQL?
Where can you find blocking and blocked sessions in PostgreSQL?
Where can you monitor database locks in PostgreSQL?
Where can you view PostgreSQL query execution statistics?
Where can you find expensive or frequently executed queries in PostgreSQL?
Where can you check table and index sizes in PostgreSQL?
Where can you identify unused indexes in PostgreSQL?
Where can you check index usage statistics?
Where can you find table bloat information in PostgreSQL?
Where can you check autovacuum activity?
Where can you view database and table statistics in PostgreSQL?
Where can you find information about PostgreSQL roles and users?
Where can you check user privileges in PostgreSQL?
Where can you find schema information in PostgreSQL?
Where can you check table definitions and column metadata?
Where can you find information about indexes in PostgreSQL?
Where can you check foreign key relationships in PostgreSQL?
Where can you find information about constraints in PostgreSQL?
Where can you view active transactions in PostgreSQL?
Where can you identify idle transactions in PostgreSQL?
Where can you check transaction isolation settings?
Where can you find information about PostgreSQL extensions?
Where can you check replication status in PostgreSQL?
Where can you monitor replication lag?
Where can you find information about replication slots?
Where can you check the status of streaming replication?
Where can you find backup and recovery configuration details?
Where can you configure WAL archiving in PostgreSQL?
Where can you find Point-in-Time Recovery configuration?
Where can you configure PostgreSQL authentication rules?
Where can you configure client connection permissions?
Where can you configure SSL settings for PostgreSQL?
Where can you configure Row-Level Security policies?
Where can you check PostgreSQL memory configuration parameters?
Where can you configure shared_buffers and work_mem?
Where can you check PostgreSQL connection limits?
Where can you configure autovacuum parameters?
Where can you find query planner configuration parameters?
Where can you check partition information for a PostgreSQL table?
Where can you find information about materialized views?
Where can you check trigger definitions in PostgreSQL?
Where can you find PostgreSQL function and procedure definitions?
Where can you monitor PostgreSQL activity using pg_stat_activity?
Where can you analyze query performance using EXPLAIN ANALYZE?
Where can PostgreSQL be integrated in a high-availability enterprise architecture?
Who developed PostgreSQL?
Who originally developed the PostgreSQL database system?
Who maintains the PostgreSQL open-source project?
Who contributes code to the PostgreSQL project?
Who decides which features are added to PostgreSQL?
Who reviews PostgreSQL source code contributions?
Who manages PostgreSQL database roles?
Who should have PostgreSQL superuser privileges?
Who should be responsible for PostgreSQL database backups?
Who should monitor PostgreSQL production databases?
Who should manage PostgreSQL replication?
Who should handle PostgreSQL failover operations?
Who should configure PostgreSQL high availability?
Who should manage PostgreSQL database security?
Who should create PostgreSQL indexes?
Who should analyze PostgreSQL query performance?
Who should investigate PostgreSQL deadlocks?
Who should troubleshoot PostgreSQL blocking queries?
Who should configure PostgreSQL autovacuum?
Who should monitor PostgreSQL replication lag?
Who should manage PostgreSQL connection pools?
Who should configure PostgreSQL memory parameters?
Who should manage PostgreSQL WAL archiving?
Who should perform PostgreSQL point-in-time recovery?
Who should validate PostgreSQL backup and restore procedures?
Who should design PostgreSQL partitioning strategies?
Who should decide which PostgreSQL indexes are required?
Who should review PostgreSQL execution plans?
Who should optimize slow PostgreSQL queries?
Who should monitor PostgreSQL database health?
Who should manage PostgreSQL roles and privileges?
Who should configure PostgreSQL Row-Level Security?
Who should manage PostgreSQL SSL certificates?
Who should investigate PostgreSQL security incidents?
Who should manage PostgreSQL schema migrations?
Who should approve PostgreSQL production schema changes?
Who should manage PostgreSQL extensions?
Who should configure PostgreSQL monitoring tools?
Who should handle PostgreSQL production incidents?
Who should design PostgreSQL disaster recovery strategies?
Who should define PostgreSQL recovery objectives?
Who should manage PostgreSQL read replicas?
Who should monitor PostgreSQL connection usage?
Who should investigate PostgreSQL table bloat?
Who should tune PostgreSQL autovacuum settings?
Who should validate PostgreSQL performance after configuration changes?
Who should design PostgreSQL high-availability architecture?
Who should manage PostgreSQL databases in a Spring Boot application?
Who should be responsible for PostgreSQL production architecture?
How does PostgreSQL architecture work?
How does PostgreSQL handle concurrent transactions?
How does MVCC work in PostgreSQL?
How does PostgreSQL manage transaction isolation?
How does PostgreSQL handle row-level locking?
How does PostgreSQL detect and handle deadlocks?
How does PostgreSQL execute a SQL query?
How does the PostgreSQL query planner choose an execution plan?
How does PostgreSQL decide whether to use an index?
How does a B-tree index work in PostgreSQL?
How does a GIN index work in PostgreSQL?
How does a GiST index work in PostgreSQL?
How does a BRIN index work in PostgreSQL?
How does PostgreSQL handle composite indexes?
How does PostgreSQL use partial indexes?
How does PostgreSQL use expression indexes?
How does EXPLAIN ANALYZE help optimize queries?
How does PostgreSQL perform a sequential scan?
How does PostgreSQL perform an index scan?
How does PostgreSQL perform a bitmap heap scan?
How does PostgreSQL perform a nested loop join?
How does PostgreSQL perform a hash join?
How does PostgreSQL perform a merge join?
How does PostgreSQL collect and use table statistics?
How does ANALYZE improve query planning?
How does VACUUM work in PostgreSQL?
How does autovacuum work in PostgreSQL?
How does PostgreSQL manage table bloat?
How does PostgreSQL handle JSONB data?
How does PostgreSQL index JSONB columns?
How does PostgreSQL handle arrays?
How does PostgreSQL implement recursive CTEs?
How does PostgreSQL execute window functions?
How does PostgreSQL handle materialized views?
How does PostgreSQL execute functions and procedures?
How does PostgreSQL execute triggers?
How does PostgreSQL implement table partitioning?
How does partition pruning improve PostgreSQL query performance?
How does PostgreSQL handle large-scale bulk data loading?
How does the PostgreSQL COPY command improve data loading performance?
How does PostgreSQL use WAL for crash recovery?
How does PostgreSQL perform point-in-time recovery?
How does PostgreSQL streaming replication work?
How does PostgreSQL handle replication slots?
How does PostgreSQL manage replication lag?
How does PostgreSQL implement high availability?
How does PostgreSQL handle automatic failover?
How does PostgreSQL connection pooling work?
How does PostgreSQL integrate with Spring Boot?
How does PostgreSQL integrate with Kafka and CDC?