explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KlCa

Settings
# exclusive inclusive rows x rows loops node
1. 0.062 1,967.041 ↑ 1.0 1 1

Aggregate (cost=10,001,868,749.79..10,001,868,749.80 rows=1 width=56) (actual time=1,967.041..1,967.041 rows=1 loops=1)

2. 49.452 1,966.769 ↓ 7.5 15 1

Hash Right Join (cost=10,001,718,770.95..10,001,868,709.63 rows=2 width=35) (actual time=1,966.765..1,966.769 rows=15 loops=1)

  • Hash Cond: (j11_id.document_id = t.id)
3. 95.007 108.672 ↑ 1.3 153,565 1

Bitmap Heap Scan on invoice j11_id (cost=1,604.88..150,766.37 rows=207,246 width=25) (actual time=22.860..108.672 rows=153,565 loops=1)

  • Recheck Cond: (document_id IS NOT NULL)
  • Heap Blocks: exact=55352
4. 13.665 13.665 ↑ 1.3 157,603 1

Bitmap Index Scan on invoice_unique_in_document_id (cost=0.00..1,553.07 rows=205,149 width=0) (actual time=13.665..13.665 rows=157,603 loops=1)

5. 0.024 1,808.645 ↓ 7.5 15 1

Hash (cost=10,001,717,166.05..10,001,717,166.05 rows=2 width=26) (actual time=1,808.645..1,808.645 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.022 1,808.621 ↓ 7.5 15 1

Nested Loop (cost=10,000,000,229.66..10,001,717,166.05 rows=2 width=26) (actual time=214.226..1,808.621 rows=15 loops=1)

7. 2.367 1,808.569 ↓ 7.5 15 1

Hash Join (cost=229.66..1,717,164.00 rows=2 width=42) (actual time=214.211..1,808.569 rows=15 loops=1)

  • Hash Cond: (t.file_id = bj25_file.id)
8. 310.389 1,805.583 ↓ 5.7 7,130 1

Seq Scan on document t (cost=0.00..1,716,931.07 rows=1,247 width=42) (actual time=0.408..1,805.583 rows=7,130 loops=1)

  • Filter: ((NOT deleted) AND ((SubPlan 4) = 'contribution'::text))
  • Rows Removed by Filter: 242069
9.          

SubPlan (forSeq Scan)

10. 1,495.194 1,495.194 ↑ 5.0 1 249,199

Index Scan using field_document_id_name_idx on field field_3 (cost=0.56..6.66 rows=5 width=9) (actual time=0.006..0.006 rows=1 loops=249,199)

  • Index Cond: ((document_id = t.id) AND (name = 'type_document'::text))
11. 0.046 0.619 ↓ 1.3 280 1

Hash (cost=226.88..226.88 rows=222 width=32) (actual time=0.619..0.619 rows=280 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
12. 0.573 0.573 ↓ 1.3 280 1

Index Scan using file_entity_id_idx1 on file bj25_file (cost=0.00..226.88 rows=222 width=32) (actual time=0.010..0.573 rows=280 loops=1)

  • Index Cond: (entity_id = 'fb80fa27-8cfa-412d-ac9b-2aa006e303c7'::uuid)
13. 0.020 0.030 ↑ 1.0 1 15

Materialize (cost=0.00..2.02 rows=1 width=16) (actual time=0.001..0.002 rows=1 loops=15)

14. 0.010 0.010 ↑ 1.0 1 1

Index Scan using entity_id_idx on entity tj25_entity (cost=0.00..2.02 rows=1 width=16) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: (id = 'fb80fa27-8cfa-412d-ac9b-2aa006e303c7'::uuid)
15.          

SubPlan (forAggregate)

16. 0.135 0.135 ↑ 5.0 1 15

Index Scan using field_document_id_name_idx on field (cost=0.56..6.66 rows=5 width=9) (actual time=0.008..0.009 rows=1 loops=15)

  • Index Cond: ((document_id = t.id) AND (name = 'type_document'::text))
17. 0.045 0.045 ↑ 5.0 1 15

Index Scan using field_document_id_name_idx on field field_1 (cost=0.56..6.66 rows=5 width=9) (actual time=0.003..0.003 rows=1 loops=15)

  • Index Cond: ((document_id = t.id) AND (name = 'type_document'::text))
18. 0.030 0.030 ↑ 5.0 1 15

Index Scan using field_document_id_name_idx on field field_2 (cost=0.56..6.66 rows=5 width=9) (actual time=0.002..0.002 rows=1 loops=15)

  • Index Cond: ((document_id = t.id) AND (name = 'type_document'::text))
Planning time : 0.975 ms
Execution time : 1,967.229 ms