> 
> > Paul wrote:
> > > I can check whether user_version matches magic number without transaction.
> > 
> > No. Executing "PRAGMA user_version" will start an automatic transaction
> > if you didn't already start an explicit one.
> > 
> > > Only when user_version does not match magic number I start transaction.
> > 
> > This will never be faster than just starting a transaction explicitly
> > and checking the version once.
> > 
> > > The only thing I am worried about is whether
> > >
> > > pragma user_version=n;
> > >
> > > respects transactions and will be rolled back automatically in case
> > > if something happens between that statement and COMMIT.
> > 
> > Please have a look at this sentence, which you quoted in your mail:
> > >> Please note that *all* accesses to the database file are done with
> > >> transactions, including reading and writing the user_version value.
> > 
> 
> I suspect that no, not all accesses to the database file are done using 
> transactions.
> What about read-only databases? Moreover, what about read-only medium?
> 
> I am actually worried not of transaction per se but of its impact on HDD.
> My databases must be opened as fast as possilbe. 
> And in 95% of cases all executed queries are SELECTs.
> I don't want sqlite to write anything to disk when, within single database
> session, data is only extracted and no modifications to database are made.
> 
> Correct me if I have a wrong model of transaction in mind.
> Maybe sqlite does not write a byte to disk if inside a transaction 
> there are only selects?
> 

So, the answer to my question is: NO.
SQLite does no writes, the begin of a transaction is simply an acquisition of 
write lock.


Thank you all for help!
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to