explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jp1H

Settings
# exclusive inclusive rows x rows loops node
1. 0.067 1,679.257 ↑ 1.2 433 1

Limit (cost=239,269.22..239,282.97 rows=500 width=127) (actual time=1,544.598..1,679.257 rows=433 loops=1)

  • Buffers: shared hit=119887 read=102912, temp read=2316 written=2325
  • I/O Timings: read=263.401
2. 77.532 1,679.190 ↑ 2.2 433 1

Unique (cost=239,269.22..239,295.98 rows=973 width=127) (actual time=1,544.596..1,679.190 rows=433 loops=1)

  • Buffers: shared hit=119887 read=102912, temp read=2316 written=2325
  • I/O Timings: read=263.401
3. 372.468 1,601.658 ↓ 131.6 128,087 1

Sort (cost=239,269.22..239,271.65 rows=973 width=127) (actual time=1,544.594..1,601.658 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=119887 read=102912, temp read=2316 written=2325
  • I/O Timings: read=263.401
4. 189.525 1,229.190 ↓ 131.6 128,087 1

Gather (cost=1,227.16..239,220.93 rows=973 width=127) (actual time=93.456..1,229.190 rows=128,087 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=119887 read=102912
  • I/O Timings: read=263.401
5. 10.111 1,039.665 ↓ 105.4 42,696 3 / 3

Nested Loop (cost=227.16..238,123.63 rows=405 width=127) (actual time=77.503..1,039.665 rows=42,696 loops=3)

  • Buffers: shared hit=119887 read=102912
  • I/O Timings: read=263.401
6. 0.354 1,013.966 ↑ 1.8 144 3 / 3

Nested Loop (cost=226.61..237,718.84 rows=263 width=127) (actual time=77.453..1,013.966 rows=144 loops=3)

  • Buffers: shared hit=115349 read=102912
  • I/O Timings: read=263.401
7. 272.351 1,011.880 ↑ 1.8 144 3 / 3

Hash Join (cost=226.33..237,640.44 rows=263 width=136) (actual time=77.418..1,011.880 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: 361980
  • Buffers: shared hit=114021 read=102912
  • I/O Timings: read=263.401
8. 732.915 732.915 ↑ 1.2 362,124 3 / 3

Parallel Seq Scan on tbl_invoice invoice0_ (cost=0.00..223,576.86 rows=442,792 width=182) (actual time=0.017..732.915 rows=362,124 loops=3)

  • Filter: (created_timestamp > to_date('2019-01-01'::text, 'YYYY-MM-DD'::text))
  • Rows Removed by Filter: 24492
  • Buffers: shared hit=113554 read=102912
  • I/O Timings: read=263.401
9. 3.651 6.614 ↓ 1.0 2,648 3 / 3

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

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

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

  • Buffers: shared hit=407
11. 0.021 0.021 ↑ 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.019..0.021 rows=1 loops=3)

  • Index Cond: ((user_id)::text = 'bdd77988-7e21-4b7d-b87c-6730ee8b58ae'::text)
  • Filter: active
  • Buffers: shared hit=11
12. 0.557 0.557 ↓ 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.009..0.557 rows=2,648 loops=3)

  • Buffers: shared hit=396
13. 1.732 1.732 ↑ 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.012..0.012 rows=1 loops=433)

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

Index Only Scan using idx_invoice_line_invoice_id on tbl_invoice_line lines3_ (cost=0.55..1.24 rows=30 width=37) (actual time=0.015..0.108 rows=296 loops=433)

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