explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BWGW

Settings
# exclusive inclusive rows x rows loops node
1. 0.082 0.239 ↑ 1.0 1 1

Insert on card_state (cost=8.48..8.74 rows=1 width=304) (actual time=0.239..0.239 rows=1 loops=1)

2.          

CTE last_card_state

3. 0.001 0.046 ↑ 1.0 1 1

Limit (cost=8.45..8.46 rows=1 width=101) (actual time=0.045..0.046 rows=1 loops=1)

4. 0.014 0.045 ↑ 1.0 1 1

Sort (cost=8.45..8.46 rows=1 width=101) (actual time=0.044..0.045 rows=1 loops=1)

  • Sort Key: card_state_1.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
5. 0.031 0.031 ↓ 8.0 8 1

Index Scan using card_state_environment_id_lifecycle_id_end_user_id_event_na_idx on card_state card_state_1 (cost=0.41..8.44 rows=1 width=101) (actual time=0.023..0.031 rows=8 loops=1)

  • Index Cond: (((environment_id)::text = '0001-czjY'::text) AND ((lifecycle_id)::text = '9o1tx320j-1'::text) AND ((end_user_id)::text = 'user1'::text) AND ((event_name)::text = 'testEvent:1'::text))
  • Filter: ((event_source = 'live'::private.event_source) AND (card_template_id = 182))
6.          

Initplan (for Insert)

7. 0.047 0.047 ↑ 1.0 1 1

CTE Scan on last_card_state (cost=0.00..0.02 rows=1 width=32) (actual time=0.046..0.047 rows=1 loops=1)

8. 0.110 0.110 ↑ 1.0 1 1

Result (cost=0.00..0.26 rows=1 width=304) (actual time=0.110..0.110 rows=1 loops=1)

Planning time : 0.442 ms
Execution time : 90.076 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint card_state_card_template_id_fkey 0.064 ms 1 0.064 ms
for constraint card_state_environment_id_fkey 0.039 ms 1 0.039 ms
card_state_queue_webhook 0.497 ms 1 0.497 ms
card_state_to_card_instance_cache_trigger 89.193 ms 1 89.193 ms