explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PSP

Settings
# exclusive inclusive rows x rows loops node
1. 58.194 22,783.844 ↓ 1.0 225 1

GroupAggregate (cost=885,875.92..885,883.76 rows=224 width=54) (actual time=22,648.057..22,783.844 rows=225 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. 381.039 22,725.650 ↓ 1,003.5 224,780 1

Sort (cost=885,875.92..885,876.48 rows=224 width=79) (actual time=22,647.960..22,725.650 rows=224,780 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: 15784kB
3. 22,344.611 22,344.611 ↓ 1,003.5 224,780 1

Seq Scan on invoice_stats inv (cost=0.00..885,867.18 rows=224 width=79) (actual time=5,797.636..22,344.611 rows=224,780 loops=1)

  • Filter: (((module)::text <> 'Release'::text) AND (date_part('month'::text, now()) = date_part('month'::text, date_time)) AND (date_part('year'::text, now()) = date_part('year'::text, date_time)))
  • Rows Removed by Filter: 10743258
Planning time : 0.414 ms
Execution time : 22,790.649 ms