Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Pavel Ivanov
> But I sqlite can still check the number of db connections open Even though as Michael have shown this is possible (with guaranteed results only when run as root) it will still have races. Because if you see only one process accessing database file at the end of transaction and only one process a

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Black, Michael (IS)
qlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Richard Hipp [d...@sqlite.org] Sent: Wednesday, August 10, 2011 1:27 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] In memory v/s tmpfs On Wed, Aug 10, 2011 at 2:13 PM, Sreekumar TP wrote: > But

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Oh Yes. I missed that point ! On Wed, Aug 10, 2011 at 11:57 PM, Richard Hipp wrote: > On Wed, Aug 10, 2011 at 2:13 PM, Sreekumar TP >wrote: > > > But I sqlite can still check the number of db connections open > > > > > No it cannot. > > In unix, there is no way for one process to know whether o

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 2:13 PM, Sreekumar TP wrote: > But I sqlite can still check the number of db connections open > No it cannot. In unix, there is no way for one process to know whether or not another process has a particular file open. And if there is a mechanism to do that in windows, I

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Ok.. But I sqlite can still check the number of db connections open and optimise the checking=> as long as there is only one writer, do not check for hot journals. Can a database have two connections opened with two different journal modes ? On Wed, Aug 10, 2011 at 11:35 PM, Pavel Ivanov wrote:

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Pavel Ivanov
> If you have one reader and many writers, consider PRAGMA journal_mode=WAL; Richard meant "one writer and many readers" of course. >> If the other process opens the db connection as read_only, will the hot >> journal check be still done (during queries operations of the second >> process)? >> >

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 1:35 PM, Sreekumar TP wrote: > Ok, its getting a bit clear. > If there is only one process that is writing to the database, but has more > than one process that reads the database, the locking mode can still be > exclusive ? > PRAGMA locking_mode=EXCLUSIVE; means "exclus

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
Ok, its getting a bit clear. If there is only one process that is writing to the database, but has more than one process that reads the database, the locking mode can still be exclusive ? If the other process opens the db connection as read_only, will the hot journal check be still done (during qu

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
On Wed, Aug 10, 2011 at 1:09 PM, Simon Slavin wrote: > > On 10 Aug 2011, at 6:01pm, Sreekumar TP wrote: > > > Thanks for the explanation. The journal mode was OFF which means there > is > > no journal file created. So why is it the check still performed ? > > Because the journal mode might have

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
The journal mode was always OFF when the code executes. The db was/is never opened with a journal. I havent analysed when exactly these calls are made, but definitely, it quite a lot.. On Wed, Aug 10, 2011 at 10:39 PM, Simon Slavin wrote: > > On 10 Aug 2011, at 6:01pm, Sreekumar TP wrote: > > >

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Simon Slavin
On 10 Aug 2011, at 6:01pm, Sreekumar TP wrote: > Thanks for the explanation. The journal mode was OFF which means there is > no journal file created. So why is it the check still performed ? Because the journal mode might have been 'ON' the last time that database was used. > On Wed, Aug 10,

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
1189370 read > > > > > > 8.160.096124 0414624 gettimeofday > > > 2.550.033750 8 fdatasync > > > > > > On Tue, Aug 9, 2011 at 7:34 PM, Pavel Ivanov > > wrote: > > > &g

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Richard Hipp
;> > Journal mode is WAL > >> > >> I believe in-memory database can't have journal mode WAL. So you > >> compare completely different settings. > >> > >> > >> Pavel > >> > >> > >> On Tue, Aug 9, 2011 at 5:15

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
> >> On Tue, Aug 9, 2011 at 5:15 AM, wrote: >> > >> > Journal mode is WAL >> > >> > >> > --Original Message-- >> > From: Roger Binns >> > Sender: sqlite-users-boun...@sqlite.org >> > To: General Discussion of SQL

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Sreekumar TP
gt; Sender: sqlite-users-boun...@sqlite.org > > To: General Discussion of SQLite Database > > ReplyTo: General Discussion of SQLite Database > > Subject: Re: [sqlite] In memory v/s tmpfs > > Sent: Aug 9, 2011 2:42 PM > > > > -BEGIN PGP SIGNED MESSAGE- > &

Re: [sqlite] In memory v/s tmpfs

2011-08-09 Thread Pavel Ivanov
lite-users-boun...@sqlite.org > To: General Discussion of SQLite Database > ReplyTo: General Discussion of SQLite Database > Subject: Re: [sqlite] In memory v/s tmpfs > Sent: Aug 9, 2011 2:42 PM > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 08/08/2011 06:3

Re: [sqlite] In memory v/s tmpfs

2011-08-09 Thread sreekumar . tp
Journal mode is WAL --Original Message-- From: Roger Binns Sender: sqlite-users-boun...@sqlite.org To: General Discussion of SQLite Database ReplyTo: General Discussion of SQLite Database Subject: Re: [sqlite] In memory v/s tmpfs Sent: Aug 9, 2011 2:42 PM -BEGIN PGP SIGNED MESSAGE

Re: [sqlite] In memory v/s tmpfs

2011-08-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/08/2011 06:34 PM, sreekumar...@gmail.com wrote: > From the point of view of performance, I expected similar performance , tmpfs > being a little slower due to filesystem overhead. However, the operations on > tmpfs was much slower than expected

Re: [sqlite] In memory v/s tmpfs

2011-08-08 Thread Pavel Ivanov
> What could be a possible explanation for this behaviour? > One difference int configurations is that the sqlite lib is built for > multithreading in the tmpfs scenario. Could it be an overhead of mutexes? Make tests with the same SQLite library. Run test with tmpfs using strace to see if files

[sqlite] In memory v/s tmpfs

2011-08-08 Thread sreekumar . tp
HI, I performed an experiment where I do db operations on an in-memory database and compared it with the results from same operations on a database in tmpfs.(Same db structure,records etc) >From the point of view of performance, I expected similar performance , tmpfs >being a little slower due