explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jWdG

Settings
# exclusive inclusive rows x rows loops node
1. 2.043 6,149.772 ↓ 8.8 1,763 1

Sort (cost=195,989.71..195,990.21 rows=200 width=152) (actual time=6,149.164..6,149.772 rows=1,763 loops=1)

  • Sort Key: lepr.partner_organization_ueid
  • Sort Method: quicksort Memory: 227kB
2. 28.580 6,147.729 ↓ 8.8 1,763 1

HashAggregate (cost=195,977.56..195,982.06 rows=200 width=152) (actual time=6,145.937..6,147.729 rows=1,763 loops=1)

  • Group Key: lepr.partner_organization_ueid
3. 85.020 6,119.149 ↓ 3.2 26,093 1

HashAggregate (cost=195,588.54..195,752.34 rows=8,190 width=85) (actual time=6,085.749..6,119.149 rows=26,093 loops=1)

  • Group Key: lepr.partner_organization_ueid, edh_ids.inn, edh_ids.kpp
4. 44.116 6,034.129 ↓ 3.5 28,395 1

Nested Loop Left Join (cost=178,812.21..195,424.74 rows=8,190 width=85) (actual time=5,275.824..6,034.129 rows=28,395 loops=1)

5. 41.457 5,848.038 ↓ 3.5 28,395 1

Nested Loop Left Join (cost=178,811.79..190,252.60 rows=8,190 width=85) (actual time=5,275.810..5,848.038 rows=28,395 loops=1)

  • Filter: ((affiliation.end_date IS NULL) OR (affiliation.end_date <= now()))
  • Rows Removed by Filter: 2
6. 49.188 5,664.596 ↓ 3.4 28,397 1

Nested Loop Left Join (cost=178,811.37..185,638.50 rows=8,238 width=85) (actual time=5,275.796..5,664.596 rows=28,397 loops=1)

7. 85.770 5,473.423 ↓ 3.4 28,397 1

Hash Join (cost=178,810.95..179,986.86 rows=8,238 width=85) (actual time=5,275.759..5,473.423 rows=28,397 loops=1)

  • Hash Cond: (statistic.edh_identifier_summary_ueid = edh_ids.ueid)
8. 3,267.190 5,133.613 ↓ 3.9 125,279 1

HashAggregate (cost=152,925.33..153,573.35 rows=32,401 width=32) (actual time=5,021.546..5,133.613 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,866.423 1,866.423 ↓ 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.017..1,866.423 rows=3,263,933 loops=1)

  • Filter: (date <= now())
10. 55.872 254.040 ↓ 1.1 84,214 1

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

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

Seq Scan on edh_identifier_summary edh_ids (cost=0.00..24,890.68 rows=79,595 width=37) (actual time=0.016..198.168 rows=84,214 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: 265291
12. 141.985 141.985 ↑ 1.0 1 28,397

Index Scan using ix_edh_identifier_summary_affiliation_cross_identifier_ueid on edh_identifier_summary_affiliation_cross c (cost=0.42..0.68 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=28,397)

  • Index Cond: (edh_ids.ueid = edh_identifier_summary_ueid)
13. 141.985 141.985 ↑ 1.0 1 28,397

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

  • Index Cond: (c.edh_affiliation_ueid = ueid)
14. 141.975 141.975 ↑ 1.0 1 28,395

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.004..0.005 rows=1 loops=28,395)

  • Index Cond: (affiliation.edh_legal_entity_partner_relation_ueid = ueid)
Planning time : 1.169 ms
Execution time : 6,150.683 ms