explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gpSR

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 70,095.653 ↑ 1.0 1 1

Aggregate (cost=1,275.99..1,276.00 rows=1 width=8) (actual time=70,095.651..70,095.653 rows=1 loops=1)

2. 33.018 70,095.633 ↑ 1.0 1 1

Merge Semi Join (cost=359.41..1,275.99 rows=1 width=4) (actual time=70,095.593..70,095.633 rows=1 loops=1)

  • Merge Cond: (p0_.id = (unnest(pal.products)))
3. 0.040 0.047 ↑ 1.0 1 1

Index Scan using products_pkey on products p0_ (cost=0.29..24.85 rows=1 width=4) (actual time=0.009..0.047 rows=1 loops=1)

  • Index Cond: (id = ANY ('{45298,50914}'::integer[]))
  • Filter: (active AND ((parent_id IS NULL) OR (SubPlan 1)))
  • Rows Removed by Filter: 1
4.          

SubPlan (for Index Scan)

5. 0.003 0.007 ↑ 1.0 1 1

Unique (cost=0.29..8.31 rows=1 width=4) (actual time=0.005..0.007 rows=1 loops=1)

6. 0.004 0.004 ↑ 1.0 1 1

Index Only Scan using products_pkey on products p1_ (cost=0.29..8.31 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (id = p0_.parent_id)
  • Heap Fetches: 1
7. 50.496 70,062.568 ↑ 1.0 44,570 1

Materialize (cost=359.12..1,139.62 rows=44,600 width=4) (actual time=46,839.886..70,062.568 rows=44,570 loops=1)

8. 9,837.819 70,012.072 ↑ 1.0 44,570 1

Unique (cost=359.12..582.12 rows=44,600 width=4) (actual time=46,839.884..70,012.072 rows=44,570 loops=1)

9. 46,782.775 60,174.253 ↓ 44,467.6 19,832,546 1

Sort (cost=359.12..360.24 rows=446 width=4) (actual time=46,839.883..60,174.253 rows=19,832,546 loops=1)

  • Sort Key: (unnest(pal.products))
  • Sort Method: external merge Disk: 352768kB
10. 13,385.144 13,391.478 ↓ 57,788.5 25,773,683 1

Nested Loop (cost=122.19..339.49 rows=446 width=4) (actual time=3.534..13,391.478 rows=25,773,683 loops=1)

11. 0.006 0.006 ↑ 1.0 1 1

Index Only Scan using accounts_pkey on accounts a5_ (cost=0.28..8.30 rows=1 width=4) (actual time=0.004..0.006 rows=1 loops=1)

  • Index Cond: (id = 2)
  • Heap Fetches: 1
12. 2.015 6.328 ↓ 1.0 453 1

Hash Join (cost=121.91..325.62 rows=446 width=68) (actual time=3.339..6.328 rows=453 loops=1)

  • Hash Cond: (aup.product_access_list_id = pal.id)
13. 0.989 1.012 ↓ 1.0 453 1

Bitmap Heap Scan on account_user_products aup (cost=11.75..209.32 rows=446 width=8) (actual time=0.028..1.012 rows=453 loops=1)

  • Recheck Cond: (account_id = 2)
  • Heap Blocks: exact=34
14. 0.023 0.023 ↓ 1.0 453 1

Bitmap Index Scan on idx_cc1182e99b6b5fba (cost=0.00..11.63 rows=446 width=0) (actual time=0.023..0.023 rows=453 loops=1)

  • Index Cond: (account_id = 2)
15. 1.628 3.301 ↑ 1.0 2,763 1

Hash (cost=75.63..75.63 rows=2,763 width=68) (actual time=3.301..3.301 rows=2,763 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 308kB
16. 1.673 1.673 ↑ 1.0 2,763 1

Seq Scan on product_access_lists pal (cost=0.00..75.63 rows=2,763 width=68) (actual time=0.004..1.673 rows=2,763 loops=1)

Planning time : 0.370 ms
Execution time : 70,163.247 ms