explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PjL4

Settings
# exclusive inclusive rows x rows loops node
1. 520.291 5,537.278 ↑ 2.2 1,763 1

HashAggregate (cost=174,090.32..174,167.36 rows=3,852 width=32) (actual time=5,536.129..5,537.278 rows=1,763 loops=1)

  • Group Key: lepr.partner_organization_ueid
  • Filter: ((sum(statistic.incoming_invoice_count) > 0) OR (sum(statistic.incoming_document_balance) > 0) OR (sum(statistic.outgoing_invoice_count) > 0) OR (sum(statistic.outgoing_document_balance) > 0))
2. 2,180.224 5,016.987 ↑ 1.1 732,679 1

Hash Join (cost=69,765.73..153,379.95 rows=828,415 width=32) (actual time=1,604.724..5,016.987 rows=732,679 loops=1)

  • Hash Cond: (statistic.edh_identifier_summary_ueid = edh_ids.ueid)
3. 1,232.242 1,232.242 ↓ 1.0 3,259,335 1

Seq Scan on edh_identifier_usage_statistic statistic (cost=0.00..63,112.14 rows=3,258,114 width=32) (actual time=0.007..1,232.242 rows=3,259,335 loops=1)

4. 49.382 1,604.521 ↓ 1.1 84,052 1

Hash (cost=68,770.79..68,770.79 rows=79,595 width=32) (actual time=1,604.521..1,604.521 rows=84,052 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 6167kB
5. 99.953 1,555.139 ↓ 1.1 84,052 1

Hash Left Join (cost=56,121.19..68,770.79 rows=79,595 width=32) (actual time=980.434..1,555.139 rows=84,052 loops=1)

  • Hash Cond: (affiliation.edh_legal_entity_partner_relation_ueid = lepr.ueid)
6. 119.531 1,170.993 ↓ 1.1 84,052 1

Hash Left Join (cost=39,838.49..51,393.66 rows=79,595 width=32) (actual time=695.897..1,170.993 rows=84,052 loops=1)

  • Hash Cond: (c.edh_affiliation_ueid = affiliation.ueid)
7. 216.051 732.982 ↓ 1.1 84,052 1

Hash Right Join (cost=25,885.62..33,424.36 rows=79,595 width=32) (actual time=376.637..732.982 rows=84,052 loops=1)

  • Hash Cond: (c.edh_identifier_summary_ueid = edh_ids.ueid)
8. 140.475 140.475 ↓ 1.1 314,254 1

Seq Scan on edh_identifier_summary_affiliation_cross c (cost=0.00..5,736.33 rows=286,433 width=32) (actual time=0.004..140.475 rows=314,254 loops=1)

9. 67.293 376.456 ↓ 1.1 84,052 1

Hash (cost=24,890.68..24,890.68 rows=79,595 width=16) (actual time=376.456..376.456 rows=84,052 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4964kB
10. 309.163 309.163 ↓ 1.1 84,052 1

Seq Scan on edh_identifier_summary edh_ids (cost=0.00..24,890.68 rows=79,595 width=16) (actual time=0.016..309.163 rows=84,052 loops=1)

  • Filter: ((((kpp)::text ~~ '77%'::text) OR (((kpp IS NULL) OR ((kpp)::text ~ '^(?:9(?:0|6).*)$'::text)) AND ((inn)::text ~~ '77%'::text))) AND (((kpp)::text !~~ '9999%'::text) OR ((kpp IS NULL) AND ((inn)::text !~~ '9999%'::text)) OR (((kpp)::text !~ '^(?:9(?:0|6).*)$'::text) AND ((inn)::text !~ '^(?:9(?:0|6).*)$'::text))))
  • Rows Removed by Filter: 264692
11. 164.416 318.480 ↓ 1.1 291,452 1

Hash (cost=8,770.94..8,770.94 rows=267,994 width=32) (actual time=318.480..318.480 rows=291,452 loops=1)

  • Buckets: 524288 Batches: 2 Memory Usage: 13197kB
12. 154.064 154.064 ↓ 1.1 291,452 1

Seq Scan on edh_affiliation affiliation (cost=0.00..8,770.94 rows=267,994 width=32) (actual time=0.005..154.064 rows=291,452 loops=1)

13. 144.421 284.193 ↓ 1.1 246,556 1

Hash (cost=13,401.20..13,401.20 rows=230,520 width=32) (actual time=284.193..284.193 rows=246,556 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 17458kB
14. 139.772 139.772 ↓ 1.1 246,556 1

Seq Scan on edh_legal_entity_partner_relation lepr (cost=0.00..13,401.20 rows=230,520 width=32) (actual time=0.003..139.772 rows=246,556 loops=1)

Planning time : 1.084 ms
Execution time : 5,538.276 ms