explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0GfH

Settings
# exclusive inclusive rows x rows loops node
1. 0.053 0.180 ↑ 1.0 1 1

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

2.          

CTE last_card_state

3. 0.001 0.038 ↑ 1.0 1 1

Limit (cost=8.45..8.46 rows=1 width=103) (actual time=0.037..0.038 rows=1 loops=1)

4. 0.012 0.037 ↑ 1.0 1 1

Sort (cost=8.45..8.46 rows=1 width=103) (actual time=0.037..0.037 rows=1 loops=1)

  • Sort Key: card_state_1.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
5. 0.025 0.025 ↓ 10.0 10 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=103) (actual time=0.018..0.025 rows=10 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.039 0.039 ↑ 1.0 1 1

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

8. 0.088 0.088 ↑ 1.0 1 1

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

Planning time : 0.225 ms
Execution time : 1.529 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint card_state_card_template_id_fkey 0.049 ms 1 0.049 ms
for constraint card_state_environment_id_fkey 0.028 ms 1 0.028 ms
card_state_queue_webhook 0.376 ms 1 0.376 ms
card_state_to_card_instance_cache_trigger 0.859 ms 1 0.859 ms