Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Sam Carleton
On Wed, Jul 21, 2010 at 11:23 AM, Simon Slavin wrote: > > On 21 Jul 2010, at 3:53pm, Sam Carleton wrote: > > > In the end, I am looking for the best way to determine if the connection > > contains the correct EventDB, since a connection can live for a LONG LONG > > time. > > Sorry, I misunderstoo

Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Simon Slavin
On 21 Jul 2010, at 3:53pm, Sam Carleton wrote: > In the end, I am looking for the best way to determine if the connection > contains the correct EventDB, since a connection can live for a LONG LONG > time. Sorry, I misunderstood. I thought that your process lasted only long enough to answer on

Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Sam Carleton
On Wed, Jul 21, 2010 at 9:47 AM, Simon Slavin wrote: > > On 21 Jul 2010, at 2:30pm, Sam Carleton wrote: > > > My issue with only attaching to the EventDB for only as long as a command > is > > trying to use it is: The EventDB is used a LOT, a WHOLE lot. If I > attach > > and drop between each l

Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Simon Slavin
On 21 Jul 2010, at 2:30pm, Sam Carleton wrote: > My issue with only attaching to the EventDB for only as long as a command is > trying to use it is: The EventDB is used a LOT, a WHOLE lot. If I attach > and drop between each little call, then within one HTTP request I might > attach and drop 3

Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Sam Carleton
On Tue, Jul 20, 2010 at 8:34 PM, Simon Slavin wrote: > > On 21 Jul 2010, at 12:42am, Sam Carleton wrote: > > > There are two equally > > important requires, one is to connect to the second "EventDB", the other > is > > that the system admin can change the EventDB at any time. > > You mean change

Re: [sqlite] Cost of PRAGMA database_list

2010-07-20 Thread Simon Slavin
On 21 Jul 2010, at 12:42am, Sam Carleton wrote: > There are two equally > important requires, one is to connect to the second "EventDB", the other is > that the system admin can change the EventDB at any time. You mean change the contents of that file, or change which file is nominated as the E

Re: [sqlite] Cost of PRAGMA database_list

2010-07-20 Thread Sam Carleton
On Mon, Jul 19, 2010 at 9:46 PM, Simon Slavin wrote: > > On 20 Jul 2010, at 2:01am, Sam Carleton wrote: > > > On Mon, Jul 19, 2010 at 3:51 PM, Simon Slavin > wrote: > > > >> You know, I think that the most efficient way to do what you want will > >> probably to always issue the 'ATTACH' command.

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Simon Slavin
On 20 Jul 2010, at 2:01am, Sam Carleton wrote: > On Mon, Jul 19, 2010 at 3:51 PM, Simon Slavin wrote: > >> You know, I think that the most efficient way to do what you want will >> probably to always issue the 'ATTACH' command. If EventsDB is already >> attached, you should get a specific erro

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 3:51 PM, Simon Slavin wrote: You know, I think that the most efficient way to do what you want will > probably to always issue the 'ATTACH' command. If EventsDB is already > attached, you should get a specific error code, which you can notice but > ignore. > So, there is

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/19/2010 07:50 AM, Sam Carleton wrote: > How expensive is doing a PRAGMA database_list? 17. Without context numbers are useless. The internal implementation involves traversing data structures and populating the VDBE so that you get the right a

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Simon Slavin
On 19 Jul 2010, at 8:11pm, Sam Carleton wrote: > In my case, new or old is of little concern except for the fact that > the old connection will be attached to the second DB, the new one will > not. So, this is why, upon getting the connection from the APR DBD, > there is a check to see if the se

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 2:58 PM, Simon Slavin wrote: > > On 19 Jul 2010, at 3:50pm, Sam Carleton wrote: > >>   - Connection to the second one if it is old (wrong physical file) or not >>   connected. > > (Actually you will get other databases shown in 'PRAGMA database_list', but > they will be th

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 2:58 PM, Simon Slavin wrote: > > On 19 Jul 2010, at 3:50pm, Sam Carleton wrote: > > > I am using the connection pooling in Apache APR's DBD system.  Currently > > there are multiple places with in one request that does the following: > > > > > >   - Get a connection to the

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Simon Slavin
On 19 Jul 2010, at 3:50pm, Sam Carleton wrote: > I am using the connection pooling in Apache APR's DBD system. Currently > there are multiple places with in one request that does the following: > > > - Get a connection to the DB > - Call PRAGMA database_list > - Iterate through the list

[sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
How expensive is doing a PRAGMA database_list? I am using the connection pooling in Apache APR's DBD system. Currently there are multiple places with in one request that does the following: - Get a connection to the DB - Call PRAGMA database_list - Iterate through the list looking for