explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ryQg

Settings
# exclusive inclusive rows x rows loops node
1. 453,654.371 906,802.317 ↑ 1.0 3 1

Gather (cost=1,000.57..7,178,292.63 rows=3 width=85) (actual time=249,684.724..906,802.317 rows=3 loops=1)

  • Output: tp_tag, (count(DISTINCT CASE WHEN (invoice_type_id = ANY ('{1,4}'::integer[])) THEN cust_id ELSE NULL::character varying END)), (sum(sales)), (sum(qty)), (count(DISTINCT CASE WHEN (invoice_type_id = ANY ('{1,4}'::integer[])) THEN sys_invoice_no ELSE NULL::character varying END))
  • Workers Planned: 1
  • Workers Launched: 1
  • Single Copy: true
  • Buffers: shared hit=851,197 read=1,522,910 written=10,320, temp read=72,436 written=72,437
2. 407,019.949 453,147.946 ↑ 1.0 3 1 / 2

GroupAggregate (cost=0.57..7,177,292.33 rows=3 width=85) (actual time=249,676.952..906,295.892 rows=3 loops=1)

  • Output: tp_tag, count(DISTINCT CASE WHEN (invoice_type_id = ANY ('{1,4}'::integer[])) THEN cust_id ELSE NULL::character varying END), sum(sales), sum(qty), count(DISTINCT CASE WHEN (invoice_type_id = ANY ('{1,4}'::integer[])) THEN sys_invoice_no ELSE NULL::character varying END)
  • Group Key: a.tp_tag
  • Buffers: shared hit=851,197 read=1,522,910 written=10,320, temp read=72,436 written=72,437
  • Worker 0: actual time=249,676.952..906295.892 rows=3 loops=1
  • Buffers: shared hit=851,197 read=1,522,910 written=10,320, temp read=72,436 written=72,437
3. 46,127.997 46,127.997 ↑ 1.0 71,806,431 1 / 2

Index Scan using idx1_test on public.palak_try_try a (cost=0.57..5,920,679.73 rows=71,806,432 width=55) (actual time=8.651..92,255.993 rows=71,806,431 loops=1)

  • Output: card_no, sys_invoice_no, invoice_type_id, mth_id, invoice_date, category_id, store_id, sales, qty, cust_id, first_purchase_date, enrollment_date, clean_date, mem_tag, cw_ncw, tp_tag
  • Buffers: shared hit=851,160 read=1,522,910 written=10,320
  • Worker 0: actual time=8.651..92255.993 rows=71,806,431 loops=1
  • Buffers: shared hit=851,160 read=1,522,910 written=10,320