explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ltCVl

Settings
# exclusive inclusive rows x rows loops node
1. 49,661.185 76,152.890 ↑ 18.7 148,165 1

GroupAggregate (cost=6,362,129.79..13,865,577.79 rows=2,768,800 width=152) (actual time=24,847.195..76,152.890 rows=148,165 loops=1)

  • Group Key: u.week, u.company_id, u.consumed_resource_uri, u.consumption_type, u.id_type
2.          

CTE unnested

3. 2,665.420 18,911.781 ↑ 8.4 3,301,615 1

ProjectSet (cost=0.44..398,377.74 rows=27,688,000 width=89) (actual time=1.473..18,911.781 rows=3,301,615 loops=1)

4. 16,246.361 16,246.361 ↑ 1.0 265,331 1

Index Scan using discover_ids_minute_idx on discover_ids_mrel (cost=0.44..257,168.94 rows=276,880 width=192) (actual time=1.040..16,246.361 rows=265,331 loops=1)

  • Index Cond: ((minute < now()) AND (minute >= (now() - '00:05:00'::interval)))
5. 6,163.564 26,491.705 ↑ 8.4 3,301,615 1

Sort (cost=5,963,752.05..6,032,972.05 rows=27,688,000 width=144) (actual time=24,845.815..26,491.705 rows=3,301,615 loops=1)

  • Sort Key: u.week, u.company_id, u.consumed_resource_uri, u.consumption_type, u.id_type
  • Sort Method: external merge Disk: 334528kB
6. 20,328.141 20,328.141 ↑ 8.4 3,301,615 1

CTE Scan on unnested u (cost=0.00..553,760.00 rows=27,688,000 width=144) (actual time=1.476..20,328.141 rows=3,301,615 loops=1)