explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9xcT

Settings
# exclusive inclusive rows x rows loops node
1. 0.030 3.212 ↑ 2.0 1 1

Subquery Scan on s1 (cost=50.36..55.02 rows=2 width=428) (actual time=3.210..3.212 rows=1 loops=1)

2. 2.355 3.182 ↑ 2.0 1 1

Result (cost=50.36..54.97 rows=2 width=436) (actual time=3.180..3.182 rows=1 loops=1)

3.          

Initplan (for Result)

4. 0.020 0.105 ↑ 1.0 1 1

Aggregate (cost=6.01..6.02 rows=1 width=8) (actual time=0.104..0.105 rows=1 loops=1)

5. 0.085 0.085 ↑ 1.0 79 1

Seq Scan on obj_indicators (cost=0.00..5.81 rows=80 width=0) (actual time=0.019..0.085 rows=79 loops=1)

  • Filter: ((ind_code <> 0) AND (project_id = 1))
  • Rows Removed by Filter: 42
6. 0.053 0.686 ↑ 2.0 1 1

Sort (cost=44.34..44.34 rows=2 width=364) (actual time=0.685..0.686 rows=1 loops=1)

  • Sort Key: idn.data_year, p.prj_name
  • Sort Method: quicksort Memory: 26kB
7. 0.146 0.633 ↑ 2.0 1 1

Nested Loop (cost=1.69..44.33 rows=2 width=364) (actual time=0.625..0.633 rows=1 loops=1)

  • Join Filter: (idn.status_rec_id = sr.id)
  • Rows Removed by Join Filter: 9
8. 0.037 0.037 ↑ 1.0 10 1

Seq Scan on status_rec sr (cost=0.00..1.10 rows=10 width=46) (actual time=0.034..0.037 rows=10 loops=1)

9. 0.022 0.450 ↑ 2.0 1 10

Materialize (cost=1.69..42.91 rows=2 width=615) (actual time=0.044..0.045 rows=1 loops=10)

10. 0.017 0.428 ↑ 2.0 1 1

Nested Loop (cost=1.69..42.90 rows=2 width=615) (actual time=0.423..0.428 rows=1 loops=1)

  • Join Filter: (idn.user_id = u.id)
  • Rows Removed by Join Filter: 9
11. 0.031 0.031 ↓ 1.4 10 1

Seq Scan on users u (cost=0.00..1.07 rows=7 width=23) (actual time=0.027..0.031 rows=10 loops=1)

12. 0.020 0.380 ↑ 2.0 1 10

Materialize (cost=1.69..41.62 rows=2 width=600) (actual time=0.038..0.038 rows=1 loops=10)

13. 0.006 0.360 ↑ 2.0 1 1

Nested Loop Left Join (cost=1.69..41.61 rows=2 width=600) (actual time=0.355..0.360 rows=1 loops=1)

14. 0.007 0.261 ↑ 2.0 1 1

Nested Loop Left Join (cost=1.40..25.00 rows=2 width=576) (actual time=0.257..0.261 rows=1 loops=1)

15. 0.006 0.236 ↑ 2.0 1 1

Nested Loop (cost=1.11..8.39 rows=2 width=557) (actual time=0.232..0.236 rows=1 loops=1)

  • Join Filter: (idn.project_id = p.id)
  • Rows Removed by Join Filter: 1
16. 0.085 0.180 ↑ 2.0 1 1

Hash Join (cost=1.11..7.29 rows=2 width=536) (actual time=0.176..0.180 rows=1 loops=1)

  • Hash Cond: (o.id = idn.org_id)
17. 0.035 0.035 ↑ 1.0 84 1

Seq Scan on orgs o (cost=0.00..5.84 rows=84 width=337) (actual time=0.013..0.035 rows=84 loops=1)

18. 0.026 0.060 ↑ 2.0 1 1

Hash (cost=1.08..1.08 rows=2 width=207) (actual time=0.059..0.060 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 0.003 0.034 ↑ 2.0 1 1

Append (cost=0.00..1.08 rows=2 width=207) (actual time=0.028..0.034 rows=1 loops=1)

20. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on ind_data idn (cost=0.00..0.00 rows=1 width=100) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: (id = 21)
21. 0.024 0.024 ↑ 1.0 1 1

Seq Scan on ind_data_2020_1 idn_1 (cost=0.00..1.07 rows=1 width=314) (actual time=0.019..0.024 rows=1 loops=1)

  • Filter: (id = 21)
  • Rows Removed by Filter: 5
22. 0.020 0.050 ↑ 1.5 2 1

Materialize (cost=0.00..1.04 rows=3 width=29) (actual time=0.048..0.050 rows=2 loops=1)

23. 0.030 0.030 ↑ 1.5 2 1

Seq Scan on projects p (cost=0.00..1.03 rows=3 width=29) (actual time=0.029..0.030 rows=2 loops=1)

24. 0.018 0.018 ↓ 0.0 0 1

Index Scan using obj_divisions_pkey on obj_divisions od (cost=0.29..8.30 rows=1 width=27) (actual time=0.017..0.018 rows=0 loops=1)

  • Index Cond: (id = idn.obj_division_id)
25. 0.093 0.093 ↑ 1.0 1 1

Index Scan using obj_oktmo_pkey on obj_oktmo oo (cost=0.29..8.30 rows=1 width=32) (actual time=0.093..0.093 rows=1 loops=1)

  • Index Cond: (id = idn.obj_oktmo_id)
26.          

SubPlan (for Result)

27. 0.012 0.036 ↑ 1.0 1 1

Aggregate (cost=1.77..1.78 rows=1 width=8) (actual time=0.036..0.036 rows=1 loops=1)

28. 0.023 0.024 ↑ 2.5 40 1

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.012..0.024 rows=40 loops=1)

29. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

Planning time : 16.974 ms
Execution time : 4.181 ms