explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gNrJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 649,295.157 ↓ 73.3 5,495 1

For example:Sort (cost=15,841.49..15,841.68 rows=75 width=128) (actual time=649,294.802..649,295.157 rows=5,495 loops=1)

  • Sort Key: (lower(lawsuit_clients_history.sys_period))
  • Sort Method: quicksort Memory: 1652kB
2. 471,964.300 649,292.708 ↓ 73.3 5,495 1

HashAggregate (cost=15,838.22..15,839.16 rows=75 width=128) (actual time=649,291.265..649,292.708 rows=5,495 loops=1)

  • Group Key: lower(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
3. 147,672.614 177,328.408 ↓ 14,644.1 655,690,875 1

Nested Loop (cost=1,000.00..14,271.09 rows=44,775 width=128) (actual time=20.956..177,328.408 rows=655,690,875 loops=1)

4. 63.194 63.194 ↓ 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..63.194 rows=119,325 loops=1)

  • Filter: (client_lawsuit_id = client_lawsuit_id)
5. 29,550.489 29,592.600 ↓ 73.3 5,495 119,325

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

6. 3.274 42.111 ↓ 73.3 5,495 1

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

  • Workers Planned: 2
  • Workers Launched: 2
7. 38.837 38.837 ↓ 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.103..38.837 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
  • QUERY PLAN
8. 0.158 55.012 ↑ 11.4 71 1

Sort (cost=146.63..148.65 rows=808 width=138) (actual time=55.009..55.012 rows=71 loops=1)

  • Sort Key: n.nspname, p.proname, (pg_get_function_arguments(p.oid))
  • Sort Method: quicksort Memory: 43kB
9. 1.378 54.854 ↑ 11.4 71 1

Hash Join (cost=1.14..107.61 rows=808 width=138) (actual time=42.495..54.854 rows=71 loops=1)

  • Hash Cond: (p.pronamespace = n.oid)
10. 53.465 53.465 ↓ 3.0 2,402 1

Seq Scan on pg_proc p (cost=0.00..89.30 rows=808 width=78) (actual time=0.052..53.465 rows=2,402 loops=1)

  • Filter: pg_function_is_visible(oid)
11. 0.004 0.011 ↑ 1.0 4 1

Hash (cost=1.09..1.09 rows=4 width=68) (actual time=0.011..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
12. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on pg_namespace n (cost=0.00..1.09 rows=4 width=68) (actual time=0.005..0.007 rows=4 loops=1)

  • Filter: ((nspname <> 'pg_catalog'::name) AND (nspname <> 'information_schema'::name))
Planning time : 0.375 ms
Execution time : 649,295.543 ms