# Result: 9dE : Evaluate and Select

Settings

### Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.011 7.671 ↑ 25,000.0 2,000 1

(cost=564,238.57..566,569.93 rows=50,000,000 width=12) (actual time=4.548..7.671 rows=2,000 loops=1)

2.

CTE user_ids

3. 0.883 3.870 ↑ 25,000.0 1,000 1

(cost=18.07..1,738.01 rows=25,000,000 width=4) (actual time=0.810..3.870 rows=1,000 loops=1)

4. 0.739 0.987 ↓ 5.0 1,000 1

(cost=17.51..19.51 rows=200 width=4) (actual time=0.785..0.987 rows=1,000 loops=1)

• Group Key: generate_series(1, 1000)
5. 0.248 0.248 ↑ 1.0 1,000 1

(cost=0.00..5.01 rows=1,000 width=4) (actual time=0.015..0.248 rows=1,000 loops=1)

6. 2.000 2.000 ↑ 1.0 1 1,000

Index Scan using user_account_id_idx on user (cost=0.56..8.58 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,000)

• Index Cond: (account_id = (generate_series(1, 1000)))
7. 0.511 4.660 ↓ 5.0 1,000 1

(cost=562,500.00..562,502.00 rows=200 width=4) (actual time=4.540..4.660 rows=1,000 loops=1)

• Group Key: user_ids.id
8. 4.149 4.149 ↑ 25,000.0 1,000 1

CTE Scan on user_ids (cost=0.00..500,000.00 rows=25,000,000 width=4) (actual time=0.812..4.149 rows=1,000 loops=1)

9. 2.000 2.000 ↑ 1.0 2 1,000

Index Scan using purchase_user_id_idx on purchase (cost=0.57..11.63 rows=2 width=12) (actual time=0.002..0.002 rows=2 loops=1,000)

• Index Cond: (user_id = user_ids.id)
Planning time Execution time : 0.549 ms : 7.941 ms