explain.depesz.com

PostgreSQL's explain analyze made readable

Result: r972

Settings
# exclusive inclusive rows x rows loops node
1. 1,308.987 36,674.527 ↑ 405.4 3,254 1

GroupAggregate (cost=1,595,925.78..1,686,652.50 rows=1,319,130 width=62) (actual time=34,087.835..36,674.527 rows=3,254 loops=1)

  • Group Key: (to_date(((date_time)::character varying)::text, 'YYYY-MM-DD'::text)), module, (CASE WHEN ((module)::text = ANY ('{OCR,Validación}'::text[])) THEN 'Documentos'::text ELSE CASE WHEN (number_of_detail_lines > '0'::numeric) THEN 'FacturasconLineas'::text ELSE 'FacturassinLineas'::text END END), (date_part('month'::text, date_time))
2. 10,268.307 35,365.540 ↓ 1.0 3,908,434 1

Sort (cost=1,595,925.78..1,605,550.52 rows=3,849,898 width=87) (actual time=34,087.735..35,365.540 rows=3,908,434 loops=1)

  • Sort Key: (to_date(((date_time)::character varying)::text, 'YYYY-MM-DD'::text)) DESC, module, (CASE WHEN ((module)::text = ANY ('{OCR,Validación}'::text[])) THEN 'Documentos'::text ELSE CASE WHEN (number_of_detail_lines > '0'::numeric) THEN 'FacturasconLineas'::text ELSE 'FacturassinLineas'::text END END), (date_part('month'::text, date_time))
  • Sort Method: external merge Disk: 307776kB
3. 25,097.233 25,097.233 ↓ 1.0 3,908,434 1

Seq Scan on invoice_stats inv (cost=0.00..806,364.45 rows=3,849,898 width=87) (actual time=0.047..25,097.233 rows=3,908,434 loops=1)

  • Filter: (((module)::text <> 'Release'::text) AND (date_time > (now() - '1 year 1 mon'::interval month)))
  • Rows Removed by Filter: 7059426
Planning time : 0.348 ms
Execution time : 36,744.188 ms