PT-01 Identify slow query and Explain plan in Postgresql

preview_player
Показать описание
Slow query:
-----------------

We can capture the slow query details using the parameter “log_min_duration_statement”

Also we should consider the below parameters
* logging_collector
* log_directory
* log_filename
* log_statement

Explain plan:
-------------

- Once you found the slow query the next step would be to take the explain plan & review the plan  of that particular query to figure out the slowness issue

- The planner is responsible for creating and execution plan for each and every query that comes into the server.

- The optimizer has to decide the most efficient execution plan whenever the planner creates the plan for the query, the plnner also determines
cost of that particular query or cost of the particular plan, the optimizer will a make decision and figure out which plan is the lowest cost
and will take that plan and give it to the executor for execution

#postgresql #Explainplan #slowquery
Рекомендации по теме