explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RNN

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 7,514.361 ↓ 0.0 0 1

Limit (cost=1.43..4.70 rows=1 width=262) (actual time=7,514.361..7,514.361 rows=0 loops=1)

2. 0.001 7,514.359 ↓ 0.0 0 1

LockRows (cost=1.43..468,479.88 rows=143,535 width=262) (actual time=7,514.359..7,514.359 rows=0 loops=1)

3. 0.001 7,514.358 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.43..467,044.53 rows=143,535 width=262) (actual time=7,514.358..7,514.358 rows=0 loops=1)

4. 16.599 7,514.357 ↓ 0.0 0 1

Nested Loop (cost=1.01..401,835.37 rows=143,535 width=259) (actual time=7,514.357..7,514.357 rows=0 loops=1)

  • Join Filter: (cd.v3_transactions_from < tx.date)
5. 8.667 326.494 ↓ 1.2 20,144 1

Nested Loop Left Join (cost=0.58..39,382.59 rows=16,565 width=68) (actual time=0.979..326.494 rows=20,144 loops=1)

6. 8.019 217.107 ↓ 1.2 20,144 1

Nested Loop (cost=0.29..33,255.43 rows=16,565 width=46) (actual time=0.956..217.107 rows=20,144 loops=1)

7. 85.084 141.958 ↓ 1.0 959 1

Nested Loop (cost=0.00..30,486.19 rows=947 width=40) (actual time=0.928..141.958 rows=959 loops=1)

  • Join Filter: (co.guid = cd.id)
  • Rows Removed by Join Filter: 1589063
8. 3.449 3.449 ↓ 1.0 2,137 1

Seq Scan on company co (cost=0.00..220.26 rows=2,126 width=26) (actual time=0.017..3.449 rows=2,137 loops=1)

9. 52.810 53.425 ↑ 1.3 744 2,137

Materialize (cost=0.00..82.64 rows=947 width=30) (actual time=0.000..0.025 rows=744 loops=2,137)

10. 0.615 0.615 ↓ 1.0 959 1

Seq Scan on company_details cd (cost=0.00..77.91 rows=947 width=30) (actual time=0.011..0.615 rows=959 loops=1)

  • Filter: (v3_from < now())
  • Rows Removed by Filter: 168
11. 67.130 67.130 ↓ 1.2 21 959

Index Scan using idx_fd7a00ab979b1ad6 on employee_account ea (cost=0.29..2.74 rows=18 width=14) (actual time=0.011..0.070 rows=21 loops=959)

  • Index Cond: (company_id = co.id)
12. 100.720 100.720 ↑ 1.0 1 20,144

Index Scan using user_account_pkey on user_account ua (cost=0.29..0.37 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=20,144)

  • Index Cond: (id = ea.id)
13. 7,171.264 7,171.264 ↓ 0.0 0 20,144

Index Scan using idx_723705d13c0c9956 on transaction tx (cost=0.43..20.99 rows=71 width=207) (actual time=0.356..0.356 rows=0 loops=20,144)

  • Index Cond: (user_account_id = ea.id)
  • Filter: (expense_state = ANY ('{new,update}'::text[]))
  • Rows Removed by Filter: 72
14. 0.000 0.000 ↓ 0.0 0

Index Scan using uniq_f02f30282fc0cb0f on receipt_photo r (cost=0.42..0.45 rows=1 width=14) (never executed)

  • Index Cond: (tx.id = transaction_id)
Planning time : 2.369 ms
Execution time : 7,514.494 ms