explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jcJ4

Settings
# exclusive inclusive rows x rows loops node
1. 17.845 359.588 ↑ 679.0 71 1

GroupAggregate (cost=84,139.54..85,836.38 rows=48,208 width=54) (actual time=327.343..359.588 rows=71 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. 98.994 341.743 ↑ 1.0 48,338 1

Sort (cost=84,139.54..84,261.97 rows=48,973 width=79) (actual time=327.254..341.743 rows=48,338 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: 3408kB
3. 242.749 242.749 ↑ 1.0 48,338 1

Index Scan using index_date_time on invoice_stats inv (cost=0.44..78,147.61 rows=48,973 width=79) (actual time=0.041..242.749 rows=48,338 loops=1)

  • Index Cond: (date_time > (now() - '7 days'::interval day))
  • Filter: ((module)::text <> 'Release'::text)
  • Rows Removed by Filter: 11167
Planning time : 0.389 ms
Execution time : 360.843 ms