explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Kaq9

Settings
# exclusive inclusive rows x rows loops node
1. 0.556 1.382 ↓ 959.0 959 1

Nested Loop Left Join (cost=1.14..49.92 rows=1 width=92) (actual time=0.063..1.382 rows=959 loops=1)

  • Filter: (((COALESCE(rappi_credit_transactions.ends_at, rappi_credit_restrictions.ends_at) IS NULL) OR (COALESCE(rappi_credit_transactions.ends_at, rappi_credit_restrictions.ends_at) > now())) AND ((rappi_credit_restrictions.starts_at IS NULL) OR (rappi_credit_restrictions.starts_at < now())) AND ((rappi_credit_restrictions.ends_at IS NULL) OR (rappi_credit_restrictions.ends_at > now())))
  • Rows Removed by Filter: 45
2. 0.163 0.826 ↓ 334.7 1,004 1

Nested Loop (cost=0.85..48.88 rows=3 width=60) (actual time=0.057..0.826 rows=1,004 loops=1)

3. 0.017 0.017 ↑ 1.0 1 1

Index Scan using rappi_credits_application_user_id_index on rappi_credits (cost=0.42..8.44 rows=1 width=5) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: (application_user_id = 131459676)
4. 0.646 0.646 ↓ 111.6 1,004 1

Index Scan using rappi_credit_transactions_rappi_credit_id_state_starts_at_index on rappi_credit_transactions (cost=0.43..40.35 rows=9 width=59) (actual time=0.038..0.646 rows=1,004 loops=1)

  • Index Cond: ((rappi_credit_id = rappi_credits.id) AND ((state)::text = 'paid'::text) AND (COALESCE(starts_at, '1900-01-01 00:00:00'::timestamp without time zone) < now()))
5. 0.000 0.000 ↓ 0.0 0 1,004

Index Scan using rappi_credit_restrictions_pkey on rappi_credit_restrictions (cost=0.29..0.32 rows=1 width=20) (actual time=0.000..0.000 rows=0 loops=1,004)

  • Index Cond: (id = rappi_credit_transactions.rappi_credit_restriction_id)
Planning time : 1.474 ms
Execution time : 1.529 ms