explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AxIf

Settings
# exclusive inclusive rows x rows loops node
1. 3,632.612 8,252.650 ↑ 5.4 1,131,061 1

GroupAggregate (cost=17,007,708.79..18,271,913.27 rows=6,157,757 width=134) (actual time=2,131.907..8,252.65 rows=1,131,061 loops=1)

  • Group Key: (to_char(date_trunc('day'::text, to_timestamp(((sbd.day / 1000))::double precision)), 'YYYY-MM-DD'::text)), sbd.brand
  • Buffers: shared hit=213,291, temp read=4,868 written=4,885
2. 1,226.326 4,620.038 ↑ 4.8 1,131,061 1

Gather Merge (cost=17,007,708.79..17,790,920.88 rows=5,385,684 width=254) (actual time=2,131.884..4,620.038 rows=1,131,061 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=317,027, temp read=15,354 written=15,406
3. 934.595 3,393.712 ↑ 7.1 377,020 3 / 3

GroupAggregate (cost=17,006,708.77..17,168,279.29 rows=2,692,842 width=254) (actual time=2,119.746..3,393.712 rows=377,020 loops=3)

  • Group Key: (to_char(date_trunc('day'::text, to_timestamp(((sbd.day / 1000))::double precision)), 'YYYY-MM-DD'::text)), sbd.brand
  • Buffers: shared hit=317,027, temp read=15,354 written=15,406
4. 1,292.583 2,459.117 ↑ 7.1 377,020 3 / 3

Sort (cost=17,006,708.77..17,013,440.87 rows=2,692,842 width=85) (actual time=2,119.724..2,459.117 rows=377,020 loops=3)

  • Sort Key: (to_char(date_trunc('day'::text, to_timestamp(((sbd.day / 1000))::double precision)), 'YYYY-MM-DD'::text)), sbd.brand
  • Sort Method: external merge Disk: 31,144kB
  • Buffers: shared hit=317,027, temp read=15,354 written=15,406
5. 968.477 1,166.534 ↑ 7.1 377,020 3 / 3

Bitmap Heap Scan on segment_brand_day sbd (cost=603,889.78..16,461,384.84 rows=2,692,842 width=85) (actual time=602.324..1,166.534 rows=377,020 loops=3)

  • Heap Blocks: exact=17,371 lossy=31,969
  • Buffers: shared hit=317,011
6. 198.057 198.057 ↑ 1.5 4,214,704 1 / 3

Bitmap Index Scan on segment_brand_day_segment_id_day_brand_unique (cost=0..602,274.07 rows=6,462,820 width=0) (actual time=594.172..594.172 rows=4,214,704 loops=1)

  • Index Cond: (((sbd.segment_id)::text = '266'::text) AND (sbd.day >= '1523146956925'::bigint) AND (sbd.day <= '1586305356925'::bigint))
  • Buffers: shared hit=163,951
Planning time : 0.168 ms
Execution time : 8,330.696 ms