Re: [sqlite] Create Read-only Database

2010-10-11 Thread Max Vlasov
On Sun, Oct 10, 2010 at 11:04 PM, Roger Binns rog...@rogerbinns.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/10/2010 11:53 AM, Max Vlasov wrote: Also if you're not content with this option, you can always open the file (just as a general file) prior to sqlite with a deny

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Michele Pradella
Soft delete could increase the SELECT speed because you have to check always for the deleted column. Moreover the DB will grow up without limit if no one physically delete the records: anyway UPDATE of a lot of records could be expensive too. I think the only way is to DELETE more frequently

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Simon Slavin
On 11 Oct 2010, at 10:26am, Michele Pradella wrote: Soft delete could increase the SELECT speed because you have to check always for the deleted column. Moreover the DB will grow up without limit if no one physically delete the records: anyway UPDATE of a lot of records could be expensive

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Michele Pradella
I know that in this use case UPDATE is lither than DELETE, but if I make a DELETE at 4am I can have the DB locked for a lot of time at 4am: I'm only shift the problem. It's not a problem of interface efficiency for user experience: the goal is to make the system always reactive without slow

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Simon Slavin
On 11 Oct 2010, at 10:56am, Michele Pradella wrote: I know that in this use case UPDATE is lither than DELETE, but if I make a DELETE at 4am I can have the DB locked for a lot of time at 4am: I'm only shift the problem. It's not a problem of interface efficiency for user experience: the

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Michele Pradella
It's what I'm doing: I'm deleting every 15 minutes of a small number of records at a time. Il 11/10/2010 12.40, Simon Slavin ha scritto: On 11 Oct 2010, at 10:56am, Michele Pradella wrote: I know that in this use case UPDATE is lither than DELETE, but if I make a DELETE at 4am I can have

Re: [sqlite] EXTERNAL:Re: Speed up DELETE of a lot of records

2010-10-11 Thread Black, Michael (IS)
I said this before but never saw a response... Just put your delete inside a select loop so it will always be interruptable. I assume you are talking about writing your own code in C or such? So rather than DELETE FROM TABLE WHERE datetime oldtime; Do this; SELECT datetime from TABLE

Re: [sqlite] Adding a string in front of what is already in a field

2010-10-11 Thread Igor Tandetnik
P Kishor punk.k...@gmail.com wrote: UPDATE OpenJobs SET notes = 'string to add in front\r\n' || notes WHERE spid = 32; Note that SQLite doesn't understand C-style escapes. '\r' is a string consisting of two characters, a backslash and a letter r. If you want to insert CRLF pair, you'd need

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Michele Pradella
Ok so the main idea it's always the same: split the DELETE to make the operation on less records, but do it more often. Il 11/10/2010 13.33, Black, Michael (IS) ha scritto: I said this before but never saw a response... Just put your delete inside a select loop so it will always be

Re: [sqlite] create_function_v2 destructor bug or doc issue

2010-10-11 Thread Richard Hipp
On Sun, Oct 10, 2010 at 11:38 PM, Roger Binns rog...@rogerbinns.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The destructor is documented to be called when the function is deleted, either by being overloaded or when the database connection closes. However it is also called if

Re: [sqlite] Adding a string in front of what is already in a field

2010-10-11 Thread P Kishor
José, Please note Igor's very important cautionary note below -- On Mon, Oct 11, 2010 at 7:05 AM, Igor Tandetnik itandet...@mvps.org wrote: P Kishor punk.k...@gmail.com wrote: UPDATE OpenJobs SET notes = 'string to add in front\r\n' || notes WHERE spid = 32; Note that SQLite doesn't

Re: [sqlite] Run Time Error #1 in VS2008

2010-10-11 Thread Doug
I use SQLite3 directly from a number of VS2008 projects and have never seen that issue. Can you find the line of code causing the problem? I am working on a project in VS2008 and I am including the sqlite3 code directly (compared to in the past using wrappers). The program is working

Re: [sqlite] C++ Unresolved external errors from DLL

2010-10-11 Thread Doug
What command line are you using with lib? I usually run the following: link /lib /def:sqlite3.def and create a .def file with all the functions that I want to call. An example of the .def file contents: EXPORTS sqlite3_aggregate_context sqlite3_aggregate_count sqlite3_auto_extension

Re: [sqlite] Run Time Error #1 in VS2008

2010-10-11 Thread John Drescher
On Sat, Oct 9, 2010 at 12:25 PM, ke...@carpentersystems.com wrote: I am working on a project in VS2008 and I am including the sqlite3 code directly (compared to in the past using wrappers).  The program is working great  (accessing DB, using calls, etc) but I have hit a peculiar issue during

Re: [sqlite] Adding a string in front of what is already in a field

2010-10-11 Thread jose isaias cabrera
P Kishor wrote... José, Please note Igor's very important cautionary note below -- On Mon, Oct 11, 2010 at 7:05 AM, Igor Tandetnik itandet...@mvps.org wrote: P Kishor punk.k...@gmail.com wrote: UPDATE OpenJobs SET notes = 'string to add in front\r\n' || notes WHERE spid = 32; Note

Re: [sqlite] EXTERNAL:Re: Speed up DELETE of a lot of records

2010-10-11 Thread Jay A. Kreibich
On Mon, Oct 11, 2010 at 06:33:11AM -0500, Black, Michael (IS) scratched on the wall: So rather than DELETE FROM TABLE WHERE datetime oldtime; Do this; SELECT datetime from TABLE where datetime oldtime; BEGIN for each record DELETE FROM TABLE where datetime=thistime; COMMIT If

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-11 Thread Jay A. Kreibich
On Mon, Oct 11, 2010 at 02:08:54PM +0200, Michele Pradella scratched on the wall: Ok so the main idea it's always the same: split the DELETE to make the operation on less records, but do it more often. Another thought occurs to me... If your insert rates are fairly consistent (e.g.

Re: [sqlite] create_function_v2 destructor bug or doc issue

2010-10-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/11/2010 06:18 AM, Richard Hipp wrote: All the other SQLite interfaces with destructors (sqlite3_create_module_v2(), sqlite3_bind_text(), sqlite3_bind_blob(), sqlite3_result_text(), sqlite3_result_blob()) also invoke their destructors

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Scott A Mintz
I am a little reluctant to modify our kernel configuration. Primarily out of ignorance because I know very little about vxWorks. Do you happen to know if these functions are used by the new WAL logic? I'm assuming by the names that they could be related to memory mapped files. What switches

Re: [sqlite] using SQLite with mod_perl

2010-10-11 Thread Clark Christensen
So, I want all the perl modules to be loaded when Apache2 starts, and then a $dbh created for each user when the user comes to the web site, but not recreated for the same user on every reload. I am assuming that would be the correct way to work speedily. I had the same problem, and it's a huge

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Scott A Mintz
I think there is a bug in 3.7.2 when you define SQLITE_OMIT_WAL. There are references to pagerPagecount() that cannot be resolved because that function is defined inside of a #ifndef SQLITE_OMIT_WAL. I also keep seeing references to 3.7.3 in this list. But the SQLite download page only has

Re: [sqlite] create_function_v2 destructor bug or doc issue

2010-10-11 Thread Richard Hipp
On Mon, Oct 11, 2010 at 11:15 AM, Roger Binns rog...@rogerbinns.com wrote: Except: sqlite3_create_collation_v2() does *not* invoke its destructor when it fails. We are thinking that is a bug and are inclined to fix it. Is changing sqlite3_create_collation_v2() to invoke its destructor

Re: [sqlite] Run Time Error #1 in VS2008

2010-10-11 Thread Kevin B. Carpenter
Thanks for responding. I realize many many people use this to develop every day, and so let me say I am of course looking at something I must be doing wrong. John: I double checked my project settings, and I am not mixing them as far as I can see. My release config is not trying to add

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Shane Harrelson
See: http://www.sqlite.org/src/info/d1ed743b6e for changes for SQLITE_OMIT_WAL. 3.7.3 should be available from the downloads page: http://www.sqlite.org/download.html as of October 8, 2010. You might need to refresh your browser cache. Direct link to the amalgamation is:

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Scott A Mintz
Thanks. I took a guess that it was fixed in 3.7.3 and manually downloaded the source. Of course hitting refresh in my browser brought up the correct page. PEBKAC. -Scott sqlite-users-boun...@sqlite.org wrote on 10/11/2010 04:04:32 PM: See: http://www.sqlite.org/src/info/d1ed743b6e