PostgreSQL DBA
2.15K subscribers
91 photos
1 video
20 files
216 links
Sharing knowledge about postgresql database
Download Telegram
What is partitioning in PostgreSQL?
It’s the process of splitting a large table into smaller pieces. It can be done through several methods, including range partitioning, list partitioning, and hash partitioning.
What commands are used to control transactions in PostgreSQL?
ans: There are 3 main commands to control transactions in PostgreSQL:
BEGIN TRANSACTION or simply BEGIN: To start a transaction.
COMMIT or END TRANSACTION: To save the changes. The COMMIT command saves all transactions to the database since the last COMMIT or ROLLBACK command.
ROLLBACK: It’s used to undo transactions that have not already been saved to the database.
How can you improve query performance in PostgreSQL?
There are multiple strategies to increase query performance, including:

Using indexing, especially in queries that involve WHERE clauses;
Writing efficient SQL statements to reduce processing overhead, for example, by avoiding unnecessary columns in the SELECT statement.
Implementing partitioning for large tables.
Optimizing memory usage by tuning server parameters to match hardware specifications.
Especially when dealing with large databases, improving your query performance is crucial to avoid undesired bottlenecks. Check out our Improving Query Performance in PostgreSQL Course to become a query wizard.
👍1
How can you handle errors in PostgreSQL?
There are two main ways to address errors in PostgreSQL:

Callback functions can be developed to handle warning and error conditions. In this case, you can specify a certain behavior in case of errors and warnings in your queries using the WHENEVER command.
Detailed information about the error or warning can be obtained from the sqlca variable. This variable provides detailed information when errors and warnings arise during execution.
What is parallel querying in PostgreSQL?
Parallel querying is a technique in PostgreSQL that allows you to create query plans that can leverage multiple CPUs to answer queries more efficiently. This technique is particularly well-suited when the query involves scanning a lot of data but returning a few rows, for example, aggregate calculations.
👍2
https://pgstatsinfo.sourceforge.net/documents/statsinfo_old/pg_statsinfo2.2.html

pg_statsinfo monitors an instance of PostgreSQL server