explain.depesz.com

PostgreSQL's explain analyze made readable

Result: p0LC

Settings
# exclusive inclusive rows x rows loops node
1. 1,544.949 9,743.803 ↑ 2.2 1,764 1

GroupAggregate (cost=298,229.53..317,818.05 rows=3,852 width=69) (actual time=7,569.615..9,743.803 rows=1,764 loops=1)

  • Group Key: lepr.partner_organization_ueid
2. 2,085.530 8,198.854 ↓ 1.0 732,136 1

Sort (cost=298,229.53..300,006.80 rows=710,909 width=69) (actual time=7,569.538..8,198.854 rows=732,136 loops=1)

  • Sort Key: lepr.partner_organization_ueid
  • Sort Method: external merge Disk: 58288kB
3. 2,290.503 6,113.324 ↓ 1.0 732,136 1

Hash Join (cost=70,237.62..199,973.14 rows=710,909 width=69) (actual time=1,790.814..6,113.324 rows=732,136 loops=1)

  • Hash Cond: (statistic.edh_identifier_summary_ueid = edh_ids.ueid)
4. 2,032.554 2,032.554 ↓ 1.2 3,257,059 1

Seq Scan on edh_identifier_usage_statistic statistic (cost=0.00..112,141.55 rows=2,795,969 width=32) (actual time=0.012..2,032.554 rows=3,257,059 loops=1)

  • Filter: ((date <= now()) AND ((incoming_invoice_count > 0) OR (incoming_document_balance > 0) OR (outgoing_invoice_count > 0) OR (outgoing_document_balance > 0)))
  • Rows Removed by Filter: 6874
5. 63.392 1,790.267 ↓ 1.1 84,213 1

Hash (cost=69,242.68..69,242.68 rows=79,595 width=53) (actual time=1,790.267..1,790.267 rows=84,213 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 7867kB
6. 111.100 1,726.875 ↓ 1.1 84,213 1

Hash Left Join (cost=56,127.08..69,242.68 rows=79,595 width=53) (actual time=1,106.751..1,726.875 rows=84,213 loops=1)

  • Hash Cond: (affiliation.edh_legal_entity_partner_relation_ueid = lepr.ueid)
7. 138.729 1,297.272 ↓ 1.1 84,213 1

Hash Left Join (cost=39,838.49..51,859.66 rows=79,595 width=53) (actual time=787.379..1,297.272 rows=84,213 loops=1)

  • Hash Cond: (c.edh_affiliation_ueid = affiliation.ueid)
8. 232.911 759.769 ↓ 1.1 84,213 1

Hash Right Join (cost=25,885.62..33,424.36 rows=79,595 width=53) (actual time=386.230..759.769 rows=84,213 loops=1)

  • Hash Cond: (c.edh_identifier_summary_ueid = edh_ids.ueid)
9. 141.228 141.228 ↓ 1.1 314,433 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..141.228 rows=314,433 loops=1)

10. 83.678 385.630 ↓ 1.1 84,213 1

Hash (cost=24,890.68..24,890.68 rows=79,595 width=37) (actual time=385.630..385.630 rows=84,213 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 6664kB
11. 301.952 301.952 ↓ 1.1 84,213 1

Seq Scan on edh_identifier_summary edh_ids (cost=0.00..24,890.68 rows=79,595 width=37) (actual time=0.027..301.952 rows=84,213 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: 265270
12. 204.040 398.774 ↓ 1.1 291,515 1

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

  • Buckets: 524288 Batches: 2 Memory Usage: 13199kB
13. 194.734 194.734 ↓ 1.1 291,515 1

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

14. 164.046 318.503 ↓ 1.1 246,611 1

Hash (cost=13,406.04..13,406.04 rows=230,604 width=32) (actual time=318.503..318.503 rows=246,611 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 17462kB
15. 154.457 154.457 ↓ 1.1 246,611 1

Seq Scan on edh_legal_entity_partner_relation lepr (cost=0.00..13,406.04 rows=230,604 width=32) (actual time=0.005..154.457 rows=246,611 loops=1)

Planning time : 1.787 ms
Execution time : 9,756.277 ms