RohitPatel9999 <rohitpatel9999-/[EMAIL PROTECTED]>
wrote:
Scenario 1
If action of some user needs to execute multiple SELECT statements
(read-only, no plan to write), it needs to start explicit transaction
to get consistent reads across read-only multiple statements.

Q1. Which one is preferable -> BEGIN TRANSACTION  or  BEGIN IMMEDIATE
?

BEGIN IMMEDIATE would block other readers. Don't use it unless you plan to write.

Q2. What is preferable After Multiple SELECT statements gets over ->
COMMIT or ROLLBACK ? (note: no change is made since only SELECTs)

I don't think it matters.

Scenario 2
If action of some user needs to execute only single SELECT statement
(read-only, no plan to write)...

As what I understand, there is no point in wrapping such single
SELECT in transaction.

Right. There's no harm either.

Q3. What is preferable, whether to start explicit transaction or not
for single SELECT ?

Doesn't matter.

Igor Tandetnik

Reply via email to