Hi!
>>>>> "sanja" == Oleksandr Byelkin <Oleksandr> writes:
<cut>
sanja> Taking into account that transactions can be read-only and transaction
sanja> can get advantage of QC before touching the table or if it do not touch
sanja> this particular table I propose for maria:
sanja> 1) Storing query in the cache
sanja> - reject queries for tables changed in the current transaction (Monty
sanja> said that it is really easy to implement such flag)
yes; I will implement this flag today.
sanja> - store "version of the table" in QC (In our case it is TrID of the
sanja> last transaction changed table, It is int64 but used only 6 bytes, and
sanja> in query cache we have ulonglong for this purpose)
sanja> 2) Checking that query data is actual
sanja> - reject queries for tables changed in the current transaction
sanja> - reject queries if stored and actual TrID mismatch
You also have to reject query for a transaction where the current
trid < TrID-for-last-transaction-that-changed-the-table.
This is becasue if the trid is to small, we have to reject rows that
was added by another transactions after the current transaction started.
Regards,
Monty