explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2gR6

Settings
# exclusive inclusive rows x rows loops node
1. 10.944 796.916 ↑ 1.0 1 1

Aggregate (cost=65,020.72..65,020.73 rows=1 width=0) (actual time=796.916..796.916 rows=1 loops=1)

2. 42.809 785.972 ↓ 3.0 24,987 1

HashAggregate (cost=64,835.37..64,917.75 rows=8,238 width=21) (actual time=771.659..785.972 rows=24,987 loops=1)

  • Group Key: edh_ids.inn, edh_ids.kpp
3. 104.359 743.163 ↓ 3.3 27,386 1

Nested Loop Semi Join (cost=0.43..64,794.18 rows=8,238 width=21) (actual time=0.107..743.163 rows=27,386 loops=1)

4. 218.809 218.809 ↓ 1.1 83,999 1

Seq Scan on edh_identifier_summary edh_ids (cost=0.00..24,890.68 rows=79,595 width=37) (actual time=0.021..218.809 rows=83,999 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: 264497
5. 419.995 419.995 ↓ 0.0 0 83,999

Index Scan using ix_edh_identifier_usage_statistic_edh_identifier_summary_ueid on edh_identifier_usage_statistic statistic (cost=0.43..5.84 rows=86 width=16) (actual time=0.005..0.005 rows=0 loops=83,999)

  • Index Cond: (edh_identifier_summary_ueid = edh_ids.ueid)
  • Filter: ((date <= '2019-12-31'::date) AND ((incoming_invoice_count > 0) OR (incoming_document_balance > 0) OR (outgoing_invoice_count > 0) OR (outgoing_document_balance > 0)))
  • Rows Removed by Filter: 1
Planning time : 0.698 ms
Execution time : 797.073 ms