explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OhgB

Settings
# exclusive inclusive rows x rows loops node
1. 7.273 238.546 ↑ 1.0 1 1

Nested Loop Left Join (cost=5,339.94..6,943.68 rows=1 width=4,710) (actual time=135.361..238.546 rows=1 loops=1)

  • Join Filter: (p0_.id = no.project_id)
  • Rows Removed by Join Filter: 12866
2. 0.009 7.290 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.15..976.91 rows=1 width=4,084) (actual time=3.929..7.290 rows=1 loops=1)

3. 0.011 7.275 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.87..968.61 rows=1 width=3,642) (actual time=3.917..7.275 rows=1 loops=1)

4. 0.040 7.235 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.57..956.48 rows=1 width=3,176) (actual time=3.883..7.235 rows=1 loops=1)

  • Join Filter: (p0_.company_id = c1_.id)
  • Rows Removed by Join Filter: 29
5. 0.013 7.166 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.57..954.81 rows=1 width=2,280) (actual time=3.865..7.166 rows=1 loops=1)

6. 7.085 7.085 ↑ 1.0 1 1

Seq Scan on project p0_ (cost=0.00..946.11 rows=1 width=1,902) (actual time=3.798..7.085 rows=1 loops=1)

  • Filter: ((secure_id)::text = 'y7FXQytt'::text)
  • Rows Removed by Filter: 12889
7. 0.016 0.068 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.57..8.69 rows=1 width=378) (actual time=0.057..0.068 rows=1 loops=1)

8. 0.022 0.022 ↑ 1.0 1 1

Index Scan using project_pkey on project p (cost=0.29..8.30 rows=1 width=12) (actual time=0.019..0.022 rows=1 loops=1)

  • Index Cond: (p0_.id = id)
9. 0.030 0.030 ↑ 1.0 1 1

Index Scan using endpoint_project_export_status_b423e462d8dae182f829545d6bd17a70 on endpoint_project_export_status epes (cost=0.28..0.37 rows=1 width=381) (actual time=0.026..0.030 rows=1 loops=1)

  • Index Cond: (p.id = project_id)
  • Filter: (endpoint_id = p.endpoint_id)
10. 0.029 0.029 ↑ 1.0 30 1

Seq Scan on company c1_ (cost=0.00..1.30 rows=30 width=896) (actual time=0.006..0.029 rows=30 loops=1)

11. 0.016 0.029 ↑ 1.0 1 1

Bitmap Heap Scan on project_cover p2_ (cost=4.30..12.11 rows=1 width=466) (actual time=0.026..0.029 rows=1 loops=1)

  • Recheck Cond: (p0_.id = project_id)
  • Filter: is_active_flag
  • Heap Blocks: exact=1
12. 0.013 0.013 ↑ 2.0 1 1

Bitmap Index Scan on project_cover_b423e462d8dae182f829545d6bd17a70 (cost=0.00..4.30 rows=2 width=0) (actual time=0.013..0.013 rows=1 loops=1)

  • Index Cond: (p0_.id = project_id)
13. 0.006 0.006 ↓ 0.0 0 1

Index Scan using project_banner_b423e462d8dae182f829545d6bd17a70 on project_banner p3_ (cost=0.28..8.29 rows=1 width=442) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (p0_.id = project_id)
  • Filter: is_active_flag
14. 223.983 223.983 ↓ 91.9 12,867 1

CTE Scan on normalized_orders no (cost=5,334.79..5,963.62 rows=140 width=626) (actual time=120.082..223.983 rows=12,867 loops=1)

  • Filter: ("order" = 1)
  • Rows Removed by Filter: 15100
15.          

CTE normalized_orders

16. 39.613 185.078 ↓ 1.0 27,967 1

WindowAgg (cost=4,775.83..5,334.79 rows=27,948 width=64) (actual time=120.070..185.078 rows=27,967 loops=1)

17. 62.058 145.465 ↓ 1.0 27,967 1

Sort (cost=4,775.83..4,845.70 rows=27,948 width=64) (actual time=120.059..145.465 rows=27,967 loops=1)

  • Sort Key: d.project_id, d.order_number
  • Sort Method: external merge Disk: 2136kB
18. 38.993 83.407 ↓ 1.0 27,967 1

Hash Join (cost=1,075.00..2,711.81 rows=27,948 width=64) (actual time=19.572..83.407 rows=27,967 loops=1)

  • Hash Cond: (d.project_id = p_1.id)
19. 24.901 24.901 ↓ 1.0 27,967 1

Seq Scan on document d (cost=0.00..1,252.52 rows=27,948 width=56) (actual time=0.013..24.901 rows=27,967 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 5887
20. 8.731 19.513 ↓ 1.0 12,890 1

Hash (cost=913.89..913.89 rows=12,889 width=8) (actual time=19.513..19.513 rows=12,890 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 632kB
21. 10.782 10.782 ↓ 1.0 12,890 1

Seq Scan on project p_1 (cost=0.00..913.89 rows=12,889 width=8) (actual time=0.004..10.782 rows=12,890 loops=1)

Planning time : 2.580 ms
Execution time : 239.919 ms