explain.depesz.com

A tool for finding a real cause for slow queries.

Result: gDr

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.024 0.450 ↓ 1.5 6 1

Sort (cost=39.90..39.91 rows=4 width=45) (actual time=0.449..0.450 rows=6 loops=1)

  • Sort Key: "*SELECT* 1".time_in_raw, "*SELECT* 1".id, (1), (("*SELECT* 1".operation_type)::integer)
  • Sort Method: quicksort Memory: 26kB
2. 0.003 0.426 ↓ 1.5 6 1

Append (cost=18.93..39.86 rows=4 width=45) (actual time=0.378..0.426 rows=6 loops=1)

3. 0.007 0.387 ↓ 6.0 6 1

Subquery Scan on "*SELECT* 1" (cost=18.93..18.95 rows=1 width=125) (actual time=0.378..0.387 rows=6 loops=1)

4. 0.005 0.380 ↓ 6.0 6 1

Unique (cost=18.93..18.94 rows=1 width=125) (actual time=0.375..0.380 rows=6 loops=1)

5. 0.031 0.375 ↓ 8.0 8 1

Sort (cost=18.93..18.93 rows=1 width=125) (actual time=0.374..0.375 rows=8 loops=1)

  • Sort Key: public.account_schedule.account_schedule_id, web_order.web_order_id, web_order_limit.time_in
  • Sort Method: quicksort Memory: 27kB
6. 0.106 0.344 ↓ 8.0 8 1

Nested Loop (cost=0.00..18.92 rows=1 width=125) (actual time=0.092..0.344 rows=8 loops=1)

7. 0.023 0.198 ↓ 8.0 8 1

Nested Loop (cost=0.00..18.54 rows=1 width=113) (actual time=0.054..0.198 rows=8 loops=1)

  • Join Filter: (web_order.store_id = web_order_limit.store_id)
8. 0.005 0.109 ↓ 6.0 6 1

Nested Loop (cost=0.00..18.23 rows=1 width=77) (actual time=0.034..0.109 rows=6 loops=1)

9. 0.009 0.080 ↓ 6.0 6 1

Nested Loop (cost=0.00..17.94 rows=1 width=52) (actual time=0.026..0.080 rows=6 loops=1)

10. 0.035 0.035 ↓ 6.0 6 1

Index Scan using "IX_account_schedule_account_id_fkey_account_schedule" on account_schedule (cost=0.00..15.06 rows=1 width=30) (actual time=0.015..0.035 rows=6 loops=1)

  • Index Cond: (account_id = 6442)
  • Filter: ((amount <> 0) AND (status = 0) AND (((operation_type = ANY ('{2,4}'::integer[])) AND (time_in < (to_date('04.05.2012'::text, 'DD.MM.YYYY'::text) + '1 day'::interval))) OR (operation_type = ANY ('{1,3}'::integer[]))))
11. 0.036 0.036 ↑ 1.0 1 6

Index Scan using web_order_pkey on web_order (cost=0.00..2.87 rows=1 width=26) (actual time=0.005..0.006 rows=1 loops=6)

  • Index Cond: (web_order_id = public.account_schedule.web_order_id)
  • Filter: (status < 2)
12. 0.024 0.024 ↑ 1.0 1 6

Index Scan using store_store_id_region_id_idx on store (cost=0.00..0.27 rows=1 width=25) (actual time=0.004..0.004 rows=1 loops=6)

  • Index Cond: (store_id = web_order.store_id)
13. 0.066 0.066 ↓ 2.0 2 6

Index Scan using web_order_limit_order_number on web_order_limit (cost=0.00..0.30 rows=1 width=51) (actual time=0.010..0.011 rows=2 loops=6)

  • Index Cond: ((order_number)::text = (web_order.order_number)::text)
  • Filter: (status = ANY ('{3,5}'::integer[]))
14. 0.040 0.040 ↑ 1.0 1 8

Index Scan using store_group_pkey on store_group (cost=0.00..0.30 rows=1 width=20) (actual time=0.003..0.005 rows=1 loops=8)

  • Index Cond: (store_group_id = store.store_group_id)
15. 0.001 0.008 ↓ 0.0 0 1

Subquery Scan on "*SELECT* 2" (cost=0.00..2.99 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=1)

16. 0.007 0.007 ↓ 0.0 0 1

Index Scan using "IX_payment_account_id_fkey_payment" on payment (cost=0.00..2.98 rows=1 width=20) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (account_id = 6442)
  • Filter: ((amount <> 0) AND (status = 0) AND (time_created >= to_date('01.05.2012'::text, 'DD.MM.YYYY'::text)) AND (time_created < (to_date('04.05.2012'::text, 'DD.MM.YYYY'::text) + '1 day'::interval)))
17. 0.000 0.018 ↓ 0.0 0 1

Subquery Scan on "*SELECT* 3" (cost=0.01..2.91 rows=1 width=12) (actual time=0.018..0.018 rows=0 loops=1)

18. 0.018 0.018 ↓ 0.0 0 1

Index Scan using account_schedule_account_id_time_in_idx on account_schedule (cost=0.01..2.90 rows=1 width=12) (actual time=0.018..0.018 rows=0 loops=1)

  • Index Cond: ((account_id = 6442) AND (time_in >= to_date('01.05.2012'::text, 'DD.MM.YYYY'::text)) AND (time_in < (to_date('04.05.2012'::text, 'DD.MM.YYYY'::text) + '1 day'::interval)))
  • Filter: ((amount <> 0) AND (operation_type = ANY ('{7,8}'::integer[])) AND (status = 0))
19. 0.000 0.010 ↓ 0.0 0 1

Subquery Scan on "*SELECT* 4" (cost=0.00..15.02 rows=1 width=22) (actual time=0.010..0.010 rows=0 loops=1)

20. 0.010 0.010 ↓ 0.0 0 1

Index Scan using "IX_account_schedule_account_id_fkey_account_schedule" on account_schedule (cost=0.00..15.01 rows=1 width=22) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (account_id = 6442)
  • Filter: ((amount <> 0) AND (operation_type = ANY ('{5,6}'::integer[])) AND (status = 0))