explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JxU9

Settings
# exclusive inclusive rows x rows loops node
1. 1.095 1,460.454 ↑ 1.1 321 1

Sort (cost=1,852,306.26..1,852,307.13 rows=348 width=31) (actual time=1,460.389..1,460.454 rows=321 loops=1)

  • Sort Key: courses.name
  • Sort Method: quicksort Memory: 58kB
2. 1.602 1,459.359 ↑ 1.1 321 1

Bitmap Heap Scan on courses (cost=44.40..1,852,291.57 rows=348 width=31) (actual time=5.474..1,459.359 rows=321 loops=1)

  • Recheck Cond: ((owner_id IS NULL) OR (owner_id = 32679))
  • Filter: (active AND (((available_for_subscription OR (available_for_subscription IS NULL)) AND (owner_id IS NULL) AND ((NOT private) OR (private IS NULL))) OR (owner_id = 32679)))
  • Rows Removed by Filter: 701
  • Heap Blocks: exact=311
3. 0.001 0.096 ↓ 0.0 0 1

BitmapOr (cost=44.40..44.40 rows=1,022 width=0) (actual time=0.096..0.096 rows=0 loops=1)

4. 0.068 0.068 ↑ 1.0 750 1

Bitmap Index Scan on index_courses_on_owner_id (cost=0.00..29.91 rows=750 width=0) (actual time=0.068..0.068 rows=750 loops=1)

  • Index Cond: (owner_id IS NULL)
5. 0.027 0.027 ↓ 1.0 279 1

Bitmap Index Scan on index_courses_on_owner_id (cost=0.00..14.32 rows=272 width=0) (actual time=0.027..0.027 rows=279 loops=1)

  • Index Cond: (owner_id = 32679)
6.          

SubPlan (forBitmap Heap Scan)

7. 86.991 1,457.661 ↑ 1.0 1 321

Aggregate (cost=5,320.97..5,320.98 rows=1 width=0) (actual time=4.541..4.541 rows=1 loops=321)

8. 245.212 1,370.670 ↓ 2.4 1,176 321

Nested Loop (cost=53.35..5,319.76 rows=483 width=0) (actual time=0.236..4.270 rows=1,176 loops=321)

9. 324.852 370.434 ↓ 2.4 1,176 321

Bitmap Heap Scan on logins (cost=52.93..3,428.30 rows=485 width=4) (actual time=0.230..1.154 rows=1,176 loops=321)

  • Recheck Cond: (account_id = 32679)
  • Filter: ((NOT (hashed SubPlan 1)) AND (role_id = 11))
  • Rows Removed by Filter: 26
  • Heap Blocks: exact=220848
10. 39.162 39.162 ↓ 1.1 1,202 321

Bitmap Index Scan on "index_ole_core.logins_on_account_id" (cost=0.00..28.68 rows=1,101 width=0) (actual time=0.122..0.122 rows=1,202 loops=321)

  • Index Cond: (account_id = 32679)
11.          

SubPlan (forBitmap Heap Scan)

12. 6.420 6.420 ↓ 4.4 22 321

Index Scan using index_train_sessions_on_account_id_and_course_id on train_sessions (cost=0.42..24.11 rows=5 width=4) (actual time=0.004..0.020 rows=22 loops=321)

  • Index Cond: ((account_id = 32679) AND (course_id = courses.id))
13. 755.024 755.024 ↑ 1.0 1 377,512

Index Only Scan using index_users_on_login_id on users (cost=0.42..3.89 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=377,512)

  • Index Cond: (login_id = logins.id)
  • Heap Fetches: 262948
Planning time : 0.448 ms
Execution time : 1,460.692 ms