explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m5JT

Settings
# exclusive inclusive rows x rows loops node
1. 0.082 454.694 ↓ 1.5 50 1

Limit (cost=39,759.35..39,759.44 rows=34 width=10,280) (actual time=454.608..454.694 rows=50 loops=1)

2. 54.151 454.612 ↓ 1.5 50 1

Sort (cost=39,759.35..39,759.44 rows=34 width=10,280) (actual time=454.607..454.612 rows=50 loops=1)

  • Sort Key: transactio0_.created_timestamp DESC
  • Sort Method: top-N heapsort Memory: 145kB
3. 16.214 400.461 ↓ 224.2 7,623 1

Nested Loop Left Join (cost=1,183.84..39,758.49 rows=34 width=10,280) (actual time=2.303..400.461 rows=7,623 loops=1)

4. 16.787 346.132 ↓ 224.2 7,623 1

Nested Loop Left Join (cost=1,183.56..39,743.62 rows=34 width=8,876) (actual time=2.291..346.132 rows=7,623 loops=1)

5. 16.621 291.230 ↓ 224.2 7,623 1

Nested Loop Left Join (cost=1,183.28..39,729.16 rows=34 width=7,480) (actual time=2.277..291.230 rows=7,623 loops=1)

6. 7.307 236.494 ↓ 224.2 7,623 1

Nested Loop Left Join (cost=1,183.00..39,718.52 rows=34 width=6,256) (actual time=2.265..236.494 rows=7,623 loops=1)

7. 31.328 191.072 ↓ 224.2 7,623 1

Hash Left Join (cost=1,182.72..39,703.65 rows=34 width=4,860) (actual time=2.251..191.072 rows=7,623 loops=1)

  • Hash Cond: ((site1_.company_id)::text = (company4_.id)::text)
  • Filter: (((transactio0_.supplier_site_id)::text = (ua.site_id)::text) OR ((company4_.main_site_id)::text = (ua.site_id)::text))
  • Rows Removed by Filter: 30554
8. 37.777 158.252 ↑ 1.5 38,177 1

Nested Loop (cost=1,001.00..39,371.41 rows=57,203 width=3,464) (actual time=0.703..158.252 rows=38,177 loops=1)

  • Join Filter: (((ua.type)::text = 'ALL'::text) OR ((ua.type)::text = (transactio0_.application)::text))
9. 0.016 0.016 ↑ 1.0 1 1

Index Scan using idx_user_access_2_user on tbl_user_access ua (cost=0.29..8.30 rows=1 width=1,164) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: active
10. 13.909 120.459 ↑ 1.6 38,177 1

Gather (cost=1,000.71..38,428.13 rows=62,332 width=2,300) (actual time=0.686..120.459 rows=38,177 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
11. 15.885 106.550 ↑ 2.0 12,726 3 / 3

Nested Loop Left Join (cost=0.71..31,194.93 rows=25,972 width=2,300) (actual time=0.038..106.550 rows=12,726 loops=3)

12. 14.311 14.311 ↑ 2.0 12,726 3 / 3

Parallel Index Scan using tbl_trx_status on tbl_transaction transactio0_ (cost=0.43..23,068.48 rows=25,972 width=1,076) (actual time=0.021..14.311 rows=12,726 loops=3)

  • Index Cond: ((status)::text = 'TODO'::text)
13. 76.354 76.354 ↑ 1.0 1 38,177 / 3

Index Scan using tbl_site_pkey on tbl_site site1_ (cost=0.28..0.31 rows=1 width=1,224) (actual time=0.006..0.006 rows=1 loops=38,177)

  • Index Cond: ((transactio0_.supplier_site_id)::text = (id)::text)
14. 0.953 1.492 ↓ 1.0 2,611 1

Hash (cost=149.10..149.10 rows=2,610 width=1,396) (actual time=1.491..1.492 rows=2,611 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 909kB
15. 0.539 0.539 ↓ 1.0 2,611 1

Seq Scan on tbl_company company4_ (cost=0.00..149.10 rows=2,610 width=1,396) (actual time=0.006..0.539 rows=2,611 loops=1)

16. 38.115 38.115 ↓ 0.0 0 7,623

Index Scan using idx_company_2_main_site on tbl_company company9_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.005..0.005 rows=0 loops=7,623)

  • Index Cond: ((site1_.id)::text = (main_site_id)::text)
17. 38.115 38.115 ↑ 1.0 1 7,623

Index Scan using tbl_site_pkey on tbl_site site2_ (cost=0.28..0.31 rows=1 width=1,224) (actual time=0.005..0.005 rows=1 loops=7,623)

  • Index Cond: ((transactio0_.client_site_id)::text = (id)::text)
18. 38.115 38.115 ↑ 1.0 1 7,623

Index Scan using tbl_company_pkey on tbl_company company3_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.005..0.005 rows=1 loops=7,623)

  • Index Cond: ((site2_.company_id)::text = (id)::text)
19. 38.115 38.115 ↑ 1.0 1 7,623

Index Scan using idx_company_2_main_site on tbl_company company10_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.005..0.005 rows=1 loops=7,623)

  • Index Cond: ((site2_.id)::text = (main_site_id)::text)
Planning time : 4.839 ms
Execution time : 455.027 ms