explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Au9o

Settings
# exclusive inclusive rows x rows loops node
1. 0.080 1,431.512 ↑ 1.2 433 1

Limit (cost=237,918.72..237,932.47 rows=500 width=127) (actual time=1,261.166..1,431.512 rows=433 loops=1)

  • Buffers: shared hit=117272 read=105524, temp read=2316 written=2325
  • I/O Timings: read=350.967
2. 96.557 1,431.432 ↑ 2.4 433 1

Unique (cost=237,918.72..237,947.38 rows=1,042 width=127) (actual time=1,261.164..1,431.432 rows=433 loops=1)

  • Buffers: shared hit=117272 read=105524, temp read=2316 written=2325
  • I/O Timings: read=350.967
3. 379.083 1,334.875 ↓ 122.9 128,087 1

Sort (cost=237,918.72..237,921.33 rows=1,042 width=127) (actual time=1,261.163..1,334.875 rows=128,087 loops=1)

  • Sort Key: invoice0_.invoice_date DESC, invoice0_.id, invoice0_.source, invoice0_.invoice_number, invoice0_.created_timestamp, company2_.name, company2_.rs_number, company1_.name, company1_.rs_number, invoice0_.amount
  • Sort Method: external merge Disk: 18528kB
  • Buffers: shared hit=117272 read=105524, temp read=2316 written=2325
  • I/O Timings: read=350.967
4. 114.987 955.792 ↓ 122.9 128,087 1

Gather (cost=1,227.16..237,866.49 rows=1,042 width=127) (actual time=56.705..955.792 rows=128,087 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=117272 read=105524
  • I/O Timings: read=350.967
5. 11.244 840.805 ↓ 98.4 42,696 3 / 3

Nested Loop (cost=227.16..236,762.29 rows=434 width=127) (actual time=47.597..840.805 rows=42,696 loops=3)

  • Buffers: shared hit=117272 read=105524
  • I/O Timings: read=350.967
6. 0.541 814.695 ↑ 2.0 144 3 / 3

Nested Loop (cost=226.61..236,331.26 rows=282 width=127) (actual time=47.546..814.695 rows=144 loops=3)

  • Buffers: shared hit=112737 read=105524
  • I/O Timings: read=350.967
7. 275.859 812.278 ↑ 2.0 144 3 / 3

Hash Join (cost=226.33..236,247.22 rows=282 width=136) (actual time=47.510..812.278 rows=144 loops=3)

  • Hash Cond: ((invoice0_.supplier_company_id)::text = (company2_.id)::text)
  • Join Filter: ((((useraccess4_.site_id)::text = (invoice0_.supplier_site_id)::text) OR ((useraccess4_.site_id)::text = (company2_.main_site_id)::text)) AND (((useraccess4_.type)::text = 'ALL'::text) OR (((useraccess4_.type)::text = 'MRT'::text) AND ((invoice0_.source)::text = 'MRT'::text)) OR (((useraccess4_.type)::text = 'ORD'::text) AND ((invoice0_.source)::text = 'ORD'::text))))
  • Rows Removed by Join Filter: 386463
  • Buffers: shared hit=111409 read=105524
  • I/O Timings: read=350.967
8. 532.787 532.787 ↑ 1.2 386,607 3 / 3

Parallel Seq Scan on tbl_invoice invoice0_ (cost=0.00..221,206.58 rows=474,058 width=182) (actual time=0.005..532.787 rows=386,607 loops=3)

  • Buffers: shared hit=110942 read=105524
  • I/O Timings: read=350.967
9. 1.528 3.632 ↓ 1.0 2,648 3 / 3

Hash (cost=193.24..193.24 rows=2,647 width=143) (actual time=3.632..3.632 rows=2,648 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 495kB
  • Buffers: shared hit=407
10. 1.364 2.104 ↓ 1.0 2,648 3 / 3

Nested Loop (cost=0.29..193.24 rows=2,647 width=143) (actual time=0.133..2.104 rows=2,648 loops=3)

  • Buffers: shared hit=407
11. 0.064 0.064 ↑ 1.0 1 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess4_ (cost=0.29..8.30 rows=1 width=41) (actual time=0.062..0.064 rows=1 loops=3)

  • Index Cond: ((user_id)::text = 'bdd77988-7e21-4b7d-b87c-6730ee8b58ae'::text)
  • Filter: active
  • Buffers: shared hit=11
12. 0.676 0.676 ↓ 1.0 2,648 3 / 3

Seq Scan on tbl_company company2_ (cost=0.00..158.47 rows=2,647 width=102) (actual time=0.012..0.676 rows=2,648 loops=3)

  • Buffers: shared hit=396
13. 1.876 1.876 ↑ 1.0 1 433 / 3

Index Scan using tbl_company_pkey on tbl_company company1_ (cost=0.28..0.30 rows=1 width=65) (actual time=0.013..0.013 rows=1 loops=433)

  • Index Cond: ((id)::text = (invoice0_.client_company_id)::text)
  • Buffers: shared hit=1328
14. 14.866 14.866 ↓ 9.9 296 433 / 3

Index Only Scan using idx_invoice_line_invoice_id on tbl_invoice_line lines3_ (cost=0.55..1.23 rows=30 width=37) (actual time=0.020..0.103 rows=296 loops=433)

  • Index Cond: (invoice_id = (invoice0_.id)::text)
  • Heap Fetches: 15127
  • Buffers: shared hit=4535
Planning time : 2.391 ms
Execution time : 1,436.857 ms