explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oITo

Settings
# exclusive inclusive rows x rows loops node
1. 61.636 22,861.367 ↓ 1.0 225 1

GroupAggregate (cost=885,802.25..885,810.09 rows=224 width=54) (actual time=22,713.388..22,861.367 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. 458.824 22,799.731 ↓ 1,001.3 224,283 1

Sort (cost=885,802.25..885,802.81 rows=224 width=79) (actual time=22,713.302..22,799.731 rows=224,283 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: 15744kB
3. 22,340.907 22,340.907 ↓ 1,001.3 224,283 1

Seq Scan on invoice_stats inv (cost=0.00..885,793.51 rows=224 width=79) (actual time=11,910.660..22,340.907 rows=224,283 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: 10743034
Planning time : 0.431 ms
Execution time : 22,866.187 ms