explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lHnm : Optimization for: plan #eI3K

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 570,046.855 719,379.865 ↓ 73.3 5,495 1

HashAggregate (cost=15,726.28..15,727.03 rows=75 width=142) (actual time=719,378.461..719,379.865 rows=5,495 loops=1)

  • Group Key: lawsuit_clients_history.sys_period, lawsuit_clients_history.stage, lawsuit_clients_history.status, lawsuit_clients_history.provision, lawsuit_clients_history.client_lawsuit_id, lawsuit_clients_history.date_insert, lawsuit_clients_history.state, lawsuit_clients_history.court, lawsuit_clients_history.value_cause_1a, lawsuit_clients_history.council, lawsuit_clients_history.justice, lawsuit_clients_history.law_firm, lawsuit_clients_history.prognostic, lawsuit_clients_history.polo
2. 120,386.008 149,333.010 ↓ 14,644.1 655,690,875 1

Nested Loop (cost=1,000.00..14,159.16 rows=44,775 width=142) (actual time=20.924..149,333.010 rows=655,690,875 loops=1)

3. 70.352 70.352 ↓ 199.9 119,325 1

Seq Scan on lawsuit_business_history (cost=0.00..3,728.56 rows=597 width=0) (actual time=0.005..70.352 rows=119,325 loops=1)

  • Filter: (client_lawsuit_id = client_lawsuit_id)
4. 28,835.328 28,876.650 ↓ 73.3 5,495 119,325

Materialize (cost=1,000.00..9,871.09 rows=75 width=142) (actual time=0.000..0.242 rows=5,495 loops=119,325)

5. 2.695 41.322 ↓ 73.3 5,495 1

Gather (cost=1,000.00..9,870.72 rows=75 width=142) (actual time=20.915..41.322 rows=5,495 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 38.627 38.627 ↓ 59.1 1,832 3

Parallel Seq Scan on lawsuit_clients_history (cost=0.00..8,863.22 rows=31 width=142) (actual time=17.107..38.627 rows=1,832 loops=3)

  • Filter: (((status)::text = ANY ('{ATIVO,ENCERRADO}'::text[])) AND (value_cause_1a >= '0'::double precision) AND (value_cause_1a <= '5e+21'::double precision) AND (value_sentence >= '0'::double precision) AND (value_sentence <= '5e+21'::double precision) AND ((justice)::text = 'CÍVEL'::text) AND ((prognostic)::text = 'PROVÁVEL'::text) AND (lower(sys_period) >= '2018-08-01 00:00:00'::timestamp without time zone) AND (lower(sys_period) <= '2019-06-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 35592
Planning time : 0.360 ms
Execution time : 719,380.298 ms