explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kQz

Settings
# exclusive inclusive rows x rows loops node
1. 0.221 38,865.070 ↑ 3,725.1 88 1

Sort (cost=2,800,562.79..2,801,382.30 rows=327,805 width=166) (actual time=38,865.030..38,865.070 rows=88 loops=1)

  • Sort Key: (date_trunc('day'::text, cr.create_ts)) DESC, ((SubPlan 1))
  • Sort Method: quicksort Memory: 38kB
2. 197.817 38,864.849 ↑ 3,725.1 88 1

GroupAggregate (cost=2,233,085.00..2,743,641.29 rows=327,805 width=166) (actual time=38,412.075..38,864.849 rows=88 loops=1)

  • Group Key: (date_trunc('day'::text, cr.create_ts)), cr.own_company
3. 704.159 38,666.504 ↓ 1.1 356,536 1

Sort (cost=2,233,085.00..2,233,904.51 rows=327,805 width=257) (actual time=38,411.523..38,666.504 rows=356,536 loops=1)

  • Sort Key: (date_trunc('day'::text, cr.create_ts)) DESC, cr.own_company
  • Sort Method: external merge Disk: 92512kB
4. 19,621.817 37,962.345 ↓ 1.1 356,536 1

Hash Right Join (cost=794,305.67..2,162,716.50 rows=327,805 width=257) (actual time=6,946.864..37,962.345 rows=356,536 loops=1)

  • Hash Cond: (ms.timeuuid = cr.timeuuid)
5. 13,455.986 13,455.986 ↓ 1.0 24,109,698 1

Seq Scan on message_status ms (cost=0.00..516,629.12 rows=23,973,112 width=98) (actual time=0.016..13,455.986 rows=24,109,698 loops=1)

6. 281.713 4,884.542 ↓ 1.1 356,536 1

Hash (cost=781,564.10..781,564.10 rows=327,805 width=191) (actual time=4,884.541..4,884.542 rows=356,536 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 10285kB
7. 4,602.829 4,602.829 ↓ 1.1 356,536 1

Seq Scan on common_request cr (cost=0.00..781,564.10 rows=327,805 width=191) (actual time=2,255.509..4,602.829 rows=356,536 loops=1)

  • Filter: ((create_ts > '2019-08-05 00:00:00'::timestamp without time zone) AND (create_ts <= '2019-08-10 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 23753162
8.          

SubPlan (forGroupAggregate)

9. 0.528 0.528 ↑ 1.0 1 88

Seq Scan on insurance_company c (cost=0.00..1.52 rows=1 width=23) (actual time=0.004..0.006 rows=1 loops=88)

  • Filter: (company_id = cr.own_company)
  • Rows Removed by Filter: 41
Planning time : 0.380 ms
Execution time : 38,886.146 ms