explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1OAh

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 0.124 ↑ 1.2 5 1

Sort (cost=88.91..88.93 rows=6 width=86) (actual time=0.124..0.124 rows=5 loops=1)

  • Sort Key: cs.external_id, cs.activation_number, cmr.date, cmr_with_end_date.end_date
  • Sort Method: quicksort Memory: 25kB
2.          

CTE cmr_with_end_date

3. 0.028 0.051 ↑ 1.0 13 1

WindowAgg (cost=32.28..32.93 rows=13 width=60) (actual time=0.028..0.051 rows=13 loops=1)

4. 0.010 0.023 ↑ 1.0 13 1

Sort (cost=32.28..32.31 rows=13 width=50) (actual time=0.021..0.023 rows=13 loops=1)

  • Sort Key: cmr_1.customer_subscription_id, cmr_1.date, cmr_1.created_at
  • Sort Method: quicksort Memory: 26kB
5. 0.008 0.013 ↑ 1.0 13 1

Bitmap Heap Scan on customer_mrr_readings cmr_1 (cost=4.38..32.04 rows=13 width=50) (actual time=0.010..0.013 rows=13 loops=1)

  • Recheck Cond: (customer_id = 14)
  • Heap Blocks: exact=1
6. 0.005 0.005 ↑ 1.0 13 1

Bitmap Index Scan on index_customer_mrr_readings_on_customer_id_and_date (cost=0.00..4.38 rows=13 width=0) (actual time=0.005..0.005 rows=13 loops=1)

  • Index Cond: (customer_id = 14)
7. 0.000 0.113 ↑ 1.2 5 1

Nested Loop (cost=0.85..55.91 rows=6 width=86) (actual time=0.062..0.113 rows=5 loops=1)

8. 0.004 0.103 ↑ 1.2 5 1

Nested Loop (cost=0.71..54.83 rows=6 width=86) (actual time=0.059..0.103 rows=5 loops=1)

9. 0.000 0.094 ↑ 1.2 5 1

Nested Loop (cost=0.56..53.77 rows=6 width=74) (actual time=0.056..0.094 rows=5 loops=1)

10. 0.001 0.084 ↑ 1.2 5 1

Nested Loop (cost=0.42..51.18 rows=6 width=62) (actual time=0.054..0.084 rows=5 loops=1)

11. 0.006 0.078 ↑ 1.2 5 1

Nested Loop (cost=0.28..50.11 rows=6 width=37) (actual time=0.052..0.078 rows=5 loops=1)

12. 0.062 0.062 ↑ 1.2 5 1

CTE Scan on cmr_with_end_date (cost=0.00..0.26 rows=6 width=13) (actual time=0.047..0.062 rows=5 loops=1)

  • Filter: has_changes
  • Rows Removed by Filter: 8
13. 0.010 0.010 ↑ 1.0 1 5

Index Scan using customer_mrr_readings_pkey on customer_mrr_readings cmr (cost=0.28..8.30 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=5)

  • Index Cond: (id = cmr_with_end_date.id)
14. 0.005 0.005 ↑ 1.0 1 5

Index Scan using customer_subscriptions_pkey on customer_subscriptions cs (cost=0.14..0.17 rows=1 width=33) (actual time=0.001..0.001 rows=1 loops=5)

  • Index Cond: (id = cmr.customer_subscription_id)
15. 0.010 0.010 ↑ 1.0 1 5

Index Scan using customers_pkey on customers c (cost=0.14..0.42 rows=1 width=20) (actual time=0.001..0.002 rows=1 loops=5)

  • Index Cond: (id = cs.customer_id)
16. 0.005 0.005 ↑ 1.0 1 5

Index Scan using plans_pkey on plans (cost=0.14..0.17 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=5)

  • Index Cond: (id = cmr.plan_id)
17. 0.010 0.010 ↑ 1.0 1 5

Index Scan using currencies_pkey on currencies (cost=0.14..0.17 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=5)

  • Index Cond: (id = cmr.currency_id)