explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WYJM

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

GroupAggregate (cost=1,559,950.45..1,637,753.15 rows=1,319,106 width=54) (actual time=34,533.367..36,730.693 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)
2. 9,782.108 35,700.018 ↓ 1.0 3,908,435 1

Sort (cost=1,559,950.45..1,569,575.01 rows=3,849,825 width=79) (actual time=34,533.272..35,700.018 rows=3,908,435 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)
  • Sort Method: external merge Disk: 270952kB
3. 25,917.910 25,917.910 ↓ 1.0 3,908,435 1

Seq Scan on invoice_stats inv (cost=0.00..796,724.63 rows=3,849,825 width=79) (actual time=0.488..25,917.910 rows=3,908,435 loops=1)

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