explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KRG

Settings
# exclusive inclusive rows x rows loops node
1. 547.422 5,691.281 ↑ 2.2 1,763 1

HashAggregate (cost=174,090.32..174,167.36 rows=3,852 width=32) (actual time=5,690.105..5,691.281 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,299.290 5,143.859 ↑ 1.1 732,679 1

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

  • Hash Cond: (statistic.edh_identifier_summary_ueid = edh_ids.ueid)
3. 1,270.779 1,270.779 ↓ 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,270.779 rows=3,259,335 loops=1)

4. 56.358 1,573.790 ↓ 1.1 84,052 1

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

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

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

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

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

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

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

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

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

9. 49.930 256.656 ↓ 1.1 84,052 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 4964kB
10. 206.726 206.726 ↓ 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.021..206.726 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: 264693
11. 178.435 345.565 ↓ 1.1 291,452 1

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

  • Buckets: 524288 Batches: 2 Memory Usage: 13197kB
12. 167.130 167.130 ↓ 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..167.130 rows=291,452 loops=1)

13. 146.208 290.734 ↓ 1.1 246,556 1

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

  • Buckets: 262144 Batches: 1 Memory Usage: 17458kB
14. 144.526 144.526 ↓ 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.004..144.526 rows=246,556 loops=1)

Planning time : 1.758 ms
Execution time : 5,692.214 ms