explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7sln

Settings
# exclusive inclusive rows x rows loops node
1. 1,038.547 37,421.041 ↑ 405.4 3,254 1

GroupAggregate (cost=1,559,891.75..1,637,691.67 rows=1,319,059 width=54) (actual time=35,156.573..37,421.041 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,926.122 36,382.494 ↓ 1.0 3,908,366 1

Sort (cost=1,559,891.75..1,569,515.97 rows=3,849,687 width=79) (actual time=35,156.495..36,382.494 rows=3,908,366 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: 270936kB
3. 26,456.372 26,456.372 ↓ 1.0 3,908,366 1

Seq Scan on invoice_stats inv (cost=0.00..796,696.03 rows=3,849,687 width=79) (actual time=0.098..26,456.372 rows=3,908,366 loops=1)

  • Filter: (((module)::text <> 'Release'::text) AND (date_time > (now() - '1 year 1 mon'::interval month)))
  • Rows Removed by Filter: 7059028
Planning time : 0.373 ms
Execution time : 37,486.889 ms