explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VvHK

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 31.698 ↑ 1.0 1 1

Limit (cost=955.07..955.08 rows=1 width=1,222) (actual time=31.696..31.698 rows=1 loops=1)

2. 0.019 31.694 ↑ 9,597.0 1 1

LockRows (cost=955.07..1,075.03 rows=9,597 width=1,222) (actual time=31.694..31.694 rows=1 loops=1)

3. 10.706 31.675 ↑ 9,597.0 1 1

Sort (cost=955.07..979.06 rows=9,597 width=1,222) (actual time=31.675..31.675 rows=1 loops=1)

  • Sort Key: ldfe.ecg_datahoraproximaexec DESC
  • Sort Method: quicksort Memory: 3,760kB
4. 6.070 20.969 ↓ 1.3 12,905 1

Hash Join (cost=25.84..907.08 rows=9,597 width=1,222) (actual time=0.266..20.969 rows=12,905 loops=1)

  • Hash Cond: (ldfe.ecg_obrigacaocli_id = obcli.ecg_obrigacaocli_id)
5. 14.649 14.649 ↓ 1.2 12,905 1

Seq Scan on ecg_dfe_leituradistdfe ldfe (cost=0.00..744.10 rows=10,980 width=1,216) (actual time=0.010..14.649 rows=12,905 loops=1)

  • Filter: ((ecg_datahoraproximaexec <= '2019-09-30 11:13:49'::timestamp without time zone) AND (isactive = 'Y'::bpchar) AND (processed = 'N'::bpchar) AND ((docstatus)::text = 'A'::text) AND (ecg_obrigacao_id = '1000007'::numeric) AND (ecg_obrigacaoprocesso_id = '1000006'::numeric))
  • Rows Removed by Filter: 2,299
6. 0.106 0.250 ↑ 1.0 479 1

Hash (cost=19.85..19.85 rows=479 width=13) (actual time=0.250..0.250 rows=479 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 30kB
7. 0.144 0.144 ↑ 1.0 479 1

Seq Scan on ecg_obrigacaocli obcli (cost=0.00..19.85 rows=479 width=13) (actual time=0.004..0.144 rows=479 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Rows Removed by Filter: 69
Planning time : 0.242 ms
Execution time : 31.965 ms