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 looking for the second database (there will be > either one or two DB) > - Connection to the second one if it is old (wrong physical file) or not > connected. > > Is this very expensive? Is it worth it to do this one time at the very > beginning of each request as to not do it multiple times?
There is something wrong with your description. With each new connection to the database (assuming that you mean you're doing something that uses sqlite3_open() you will get no attached database files. The ATTACH command affects the connection you made with _open(), not the database file you connected to. (Actually you will get other databases shown in 'PRAGMA database_list', but they will be things SQLite uses internally, like the 'temp' database space.) Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users