explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tdy1 : mrd.attr for the win / loss

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 21,128.977 ↑ 6,944.4 9 1

Limit (cost=2,275,160.22..2,275,316.47 rows=62,500 width=448) (actual time=21,128.973..21,128.977 rows=9 loops=1)

2.          

CTE container_x98568b0

3. 0.007 0.068 ↓ 3.0 9 1

Nested Loop (cost=0.00..22.42 rows=3 width=8) (actual time=0.039..0.068 rows=9 loops=1)

4. 0.020 0.020 ↑ 1.0 1 1

Index Scan using biblio_record_entry_bucket_pkey on biblio_record_entry_bucket c (cost=0.00..8.27 rows=1 width=4) (actual time=0.020..0.020 rows=1 loops=1)

  • Index Cond: (id = 17526)
  • Filter: ((pub IS TRUE) AND (btype = 'bookbag'::text))
5. 0.041 0.041 ↓ 3.0 9 1

Index Scan using item_once_per_bucket on biblio_record_entry_bucket_item ci (cost=0.00..14.12 rows=3 width=12) (actual time=0.016..0.041 rows=9 loops=1)

  • Index Cond: (bucket = 17526)
6. 0.036 21,128.972 ↑ 273,490.4 9 1

Sort (cost=2,275,137.81..2,281,291.34 rows=2,461,414 width=448) (actual time=21,128.971..21,128.972 rows=9 loops=1)

  • Sort Key: ((1.0 / (avg(1) + 1::numeric))), (first((mrd.attrs -> 'date1'::text)))
  • Sort Method: quicksort Memory: 26kB
7. 0.375 21,128.936 ↑ 273,490.4 9 1

GroupAggregate (cost=1,159,083.06..2,066,759.81 rows=2,461,414 width=448) (actual time=21,111.089..21,128.936 rows=9 loops=1)

8. 479.629 21,128.561 ↑ 273,490.4 9 1

Merge Join (cost=1,159,083.06..1,365,256.82 rows=2,461,414 width=448) (actual time=13,651.488..21,128.561 rows=9 loops=1)

  • Merge Cond: (m.source = mrd.id)
9. 402.330 2,259.399 ↑ 273,490.4 9 1

Merge Left Join (cost=0.08..156,711.53 rows=2,461,414 width=8) (actual time=77.031..2,259.399 rows=9 loops=1)

  • Merge Cond: (m.source = container_x98568b0.record)
  • Filter: (container_x98568b0.* IS NOT NULL)
10. 1,856.965 1,856.965 ↓ 1.0 2,477,447 1

Index Scan using metabib_metarecord_source_map_source_record_idx on metarecord_source_map m (cost=0.00..150,526.94 rows=2,473,783 width=8) (actual time=0.021..1,856.965 rows=2,477,447 loops=1)

11. 0.018 0.104 ↓ 3.0 9 1

Sort (cost=0.08..0.09 rows=3 width=40) (actual time=0.100..0.104 rows=9 loops=1)

  • Sort Key: container_x98568b0.record
  • Sort Method: quicksort Memory: 25kB
12. 0.086 0.086 ↓ 3.0 9 1

CTE Scan on container_x98568b0 (cost=0.00..0.06 rows=3 width=40) (actual time=0.048..0.086 rows=9 loops=1)

13. 1,518.697 18,389.533 ↑ 1.0 2,505,393 1

Materialize (cost=1,159,082.45..1,171,613.52 rows=2,506,213 width=448) (actual time=13,521.159..18,389.533 rows=2,505,393 loops=1)

14. 14,016.623 16,870.836 ↑ 1.0 2,505,393 1

Sort (cost=1,159,082.45..1,165,347.98 rows=2,506,213 width=448) (actual time=13,521.152..16,870.836 rows=2,505,393 loops=1)

  • Sort Key: mrd.id
  • Sort Method: external merge Disk: 1133264kB
15. 2,854.213 2,854.213 ↓ 1.0 2,509,044 1

Seq Scan on record_attr mrd (cost=0.00..387,305.13 rows=2,506,213 width=448) (actual time=0.026..2,854.213 rows=2,509,044 loops=1)

Total runtime : 21,428.461 ms