explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C8HQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 57.291 ↓ 3.0 100 1

Limit (cost=709.24..709.82 rows=33 width=36) (actual time=57.210..57.291 rows=100 loops=1)

2. 0.051 57.267 ↓ 3.0 100 1

Unique (cost=709.24..709.82 rows=33 width=36) (actual time=57.207..57.267 rows=100 loops=1)

3. 3.784 57.216 ↓ 3.0 100 1

Sort (cost=709.24..709.32 rows=33 width=36) (actual time=57.205..57.216 rows=100 loops=1)

  • Sort Key: product_group_products.id, product_group_products.product_group_id, product_group_products.product_groupable_id, product_group_products.product_groupable_type, product_group_products.created_at, product_group_products.updated_at
  • Sort Method: quicksort Memory: 534kB
4. 5.293 53.432 ↓ 132.5 4,371 1

Nested Loop (cost=30.71..708.41 rows=33 width=36) (actual time=0.842..53.432 rows=4,371 loops=1)

5. 1.269 35.026 ↓ 132.5 4,371 1

Nested Loop (cost=30.42..695.96 rows=33 width=44) (actual time=0.784..35.026 rows=4,371 loops=1)

6. 0.030 0.030 ↑ 1.0 1 1

Index Scan using index_users_on_id on users (cost=0.28..8.30 rows=1 width=4) (actual time=0.028..0.030 rows=1 loops=1)

  • Index Cond: (id = 245)
  • Filter: (NOT archived)
7. 6.232 33.727 ↓ 132.5 4,371 1

Nested Loop (cost=30.14..687.33 rows=33 width=48) (actual time=0.755..33.727 rows=4,371 loops=1)

8. 8.049 14.367 ↓ 125.0 4,376 1

Hash Join (cost=29.85..672.91 rows=35 width=40) (actual time=0.716..14.367 rows=4,376 loops=1)

  • Hash Cond: (product_group_products.product_group_id = product_groups.id)
9. 5.658 5.658 ↓ 1.0 27,700 1

Seq Scan on product_group_products (cost=0.00..538.91 rows=27,691 width=36) (actual time=0.014..5.658 rows=27,700 loops=1)

10. 0.096 0.660 ↓ 132.0 264 1

Hash (cost=29.83..29.83 rows=2 width=8) (actual time=0.659..0.660 rows=264 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
11. 0.074 0.564 ↓ 132.0 264 1

Nested Loop (cost=1.47..29.83 rows=2 width=8) (actual time=0.158..0.564 rows=264 loops=1)

12. 0.008 0.200 ↑ 1.0 1 1

Nested Loop (cost=0.00..21.13 rows=1 width=12) (actual time=0.070..0.200 rows=1 loops=1)

  • Join Filter: (programs.id = programs_users.program_id)
  • Rows Removed by Join Filter: 46
13. 0.143 0.143 ↑ 1.0 1 1

Seq Scan on programs_users (cost=0.00..16.80 rows=1 width=8) (actual time=0.019..0.143 rows=1 loops=1)

  • Filter: (user_id = 245)
  • Rows Removed by Filter: 943
14. 0.049 0.049 ↓ 1.7 47 1

Seq Scan on programs (cost=0.00..3.98 rows=28 width=4) (actual time=0.013..0.049 rows=47 loops=1)

  • Filter: (active AND active AND (start_date <= '2019-06-07'::date) AND (end_date >= '2019-06-07'::date))
  • Rows Removed by Filter: 85
15. 0.229 0.290 ↓ 13.9 264 1

Bitmap Heap Scan on product_groups (cost=1.47..8.51 rows=19 width=8) (actual time=0.082..0.290 rows=264 loops=1)

  • Recheck Cond: ((program_id = programs.id) AND (program_id IS NOT NULL))
  • Heap Blocks: exact=36
16. 0.061 0.061 ↓ 13.9 264 1

Bitmap Index Scan on index_product_groups_on_program_id (cost=0.00..1.47 rows=19 width=0) (actual time=0.061..0.061 rows=264 loops=1)

  • Index Cond: ((program_id = programs.id) AND (program_id IS NOT NULL))
17. 13.128 13.128 ↑ 1.0 1 4,376

Index Scan using products_pkey on products (cost=0.29..0.40 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=4,376)

  • Index Cond: (internal_id = product_group_products.product_groupable_id)
  • Filter: ((updated_at > '2016-08-19 22:09:04'::timestamp without time zone) OR (product_group_products.updated_at > '2016-08-19 22:09:04'::timestamp without time zone))
  • Rows Removed by Filter: 0
18. 13.113 13.113 ↑ 1.0 1 4,371

Index Only Scan using index_product_translations_on_product_id on product_translations (cost=0.29..0.37 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=4,371)

  • Index Cond: (product_id = products.internal_id)
  • Heap Fetches: 4371
Planning time : 6.832 ms
Execution time : 57.660 ms