2

Capture this:

for _, t in box.space.session.index.user:pairs({uid}) do
    local session_id = t[F.session.id]
    box.space.session:delete({session_id})
end

Can there be any performance or correctness problems?

Tarantool 1.9

asnelzin
  • 174
  • 2
  • 11

1 Answers1

1

It's totally fine. However, be advised of the following:

  • if you don't use transactions, you may or may not walk over records that are being inserted while you're iterating over space.
  • adding transactions would boost performance
  • but, transactions that consist of more than several thousand records may freeze tarantool for too long, so final decision depends on your typical load
Dmitry Sharonov
  • 471
  • 2
  • 12