explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DbIg

Settings
# exclusive inclusive rows x rows loops node
1. 0.239 5,100.891 ↑ 1.3 156 1

Sort (cost=181,158.53..181,159.03 rows=200 width=152) (actual time=5,100.821..5,100.891 rows=156 loops=1)

  • Sort Key: lepr.partner_organization_ueid
  • Sort Method: quicksort Memory: 40kB
2. 2.433 5,100.652 ↑ 1.3 156 1

HashAggregate (cost=181,146.38..181,150.88 rows=200 width=152) (actual time=5,100.501..5,100.652 rows=156 loops=1)

  • Group Key: lepr.partner_organization_ueid
3. 5.532 5,098.219 ↓ 4.3 1,467 1

HashAggregate (cost=181,130.00..181,136.90 rows=345 width=85) (actual time=5,095.868..5,098.219 rows=1,467 loops=1)

  • Group Key: lepr.partner_organization_ueid, edh_ids.inn, edh_ids.kpp
4. 2.430 5,092.687 ↓ 4.6 1,601 1

Nested Loop Left Join (cost=177,859.22..181,123.10 rows=345 width=85) (actual time=4,892.186..5,092.687 rows=1,601 loops=1)

5. 3.793 5,080.651 ↓ 4.6 1,601 1

Nested Loop Left Join (cost=177,858.80..180,905.22 rows=345 width=85) (actual time=4,892.173..5,080.651 rows=1,601 loops=1)

  • Filter: ((affiliation.end_date IS NULL) OR (affiliation.end_date <= now()))
6. 3.278 5,068.853 ↓ 4.6 1,601 1

Nested Loop Left Join (cost=177,858.38..180,710.87 rows=347 width=85) (actual time=4,892.160..5,068.853 rows=1,601 loops=1)

7. 60.598 5,055.969 ↓ 4.6 1,601 1

Hash Join (cost=177,857.96..178,954.96 rows=347 width=85) (actual time=4,892.137..5,055.969 rows=1,601 loops=1)

  • Hash Cond: (statistic.edh_identifier_summary_ueid = edh_ids.ueid)
8. 3,048.027 4,823.564 ↓ 3.9 125,279 1

HashAggregate (cost=152,925.33..153,573.35 rows=32,401 width=32) (actual time=4,720.200..4,823.564 rows=125,279 loops=1)

  • Group Key: statistic.edh_identifier_summary_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))
  • Rows Removed by Filter: 8
9. 1,775.537 1,775.537 ↓ 1.0 3,263,933 1

Seq Scan on edh_identifier_usage_statistic statistic (cost=0.00..79,514.53 rows=3,262,702 width=32) (actual time=0.025..1,775.537 rows=3,263,933 loops=1)

  • Filter: (date <= now())
10. 2.937 171.807 ↓ 1.3 4,275 1

Hash (cost=24,890.68..24,890.68 rows=3,356 width=37) (actual time=171.807..171.807 rows=4,275 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 349kB
11. 168.870 168.870 ↓ 1.3 4,275 1

Seq Scan on edh_identifier_summary edh_ids (cost=0.00..24,890.68 rows=3,356 width=37) (actual time=0.056..168.870 rows=4,275 loops=1)

  • Filter: ((((kpp)::text ~~ '24%'::text) OR (((kpp IS NULL) OR ((kpp)::text ~ '^(?:9(?:0|6).*)$'::text)) AND ((inn)::text ~~ '24%'::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: 345238
12. 9.606 9.606 ↑ 1.0 1 1,601

Index Scan using ix_edh_identifier_summary_affiliation_cross_identifier_ueid on edh_identifier_summary_affiliation_cross c (cost=0.42..5.05 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=1,601)

  • Index Cond: (edh_ids.ueid = edh_identifier_summary_ueid)
13. 8.005 8.005 ↑ 1.0 1 1,601

Index Scan using edh_affiliation_pkey on edh_affiliation affiliation (cost=0.42..0.55 rows=1 width=40) (actual time=0.005..0.005 rows=1 loops=1,601)

  • Index Cond: (c.edh_affiliation_ueid = ueid)
14. 9.606 9.606 ↑ 1.0 1 1,601

Index Scan using edh_legal_entity_partner_relation_pkey on edh_legal_entity_partner_relation lepr (cost=0.42..0.62 rows=1 width=32) (actual time=0.005..0.006 rows=1 loops=1,601)

  • Index Cond: (affiliation.edh_legal_entity_partner_relation_ueid = ueid)
Planning time : 1.159 ms
Execution time : 5,101.214 ms