Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dan Kennedy
On 02/08/2011 10:24 PM, Dennis Geldhof wrote: >> -Original Message- >> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >> boun...@sqlite.org] On Behalf Of Dan Kennedy >> Sent: dinsdag 8 februari 2011 14:51 >> To: sqlite-users@sqlite.org >> Subject: Re: [sqlite] database disk

Re: [sqlite] Feature Request: PRAGMA foreign_key_list(tableName) should display the name of the foreign key constraint

2011-02-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/08/2011 07:55 PM, BareFeetWare wrote: > Currently, I have to run pragma foreign_key_list() for each of my tables, ... Create virtual table(s) and query those as needed. Use the experience to document what worked best, any gotchas and as

Re: [sqlite] Feature Request: PRAGMA foreign_key_list(tableName) should display the name of the foreign key constraint

2011-02-08 Thread BareFeetWare
> On Feb 8, 2011, at 9:07 PM, Rami Abughazaleh wrote: > >> I would like to request that "PRAGMA foreign_key_list(tableName)" display >> the name of the foreign key constraint. Thirded! Or, much better yet, move away from pragmas altogether for introspection, instead using internal tables/views

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
thanks. On 2/8/2011 3:24 PM, Teg wrote: > > Hello Nathan, > > It could be hardware but, my experience with my users is that anything > weird like this is virus scanner of firewall related. You can suggest > that they try telling the V scanner to ignore the folder your data > resides in and see if

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Teg
Hello Nathan, It could be hardware but, my experience with my users is that anything weird like this is virus scanner of firewall related. You can suggest that they try telling the V scanner to ignore the folder your data resides in and see if it makes a difference. That's my normal suggestion to

Re: [sqlite] Feature Request: PRAGMA foreign_key_list(tableName) should display the name of the foreign key constraint

2011-02-08 Thread Petite Abeille
On Feb 8, 2011, at 9:07 PM, Rami Abughazaleh wrote: > I would like to request that "PRAGMA foreign_key_list(tableName)" display > the name of the foreign key constraint. Seconded! :) Unfortunately this doesn't seem to be a priority:

[sqlite] Feature Request: PRAGMA foreign_key_list(tableName) should display the name of the foreign key constraint

2011-02-08 Thread Rami Abughazaleh
Hi. Thank you for sqlite3. I would like to request that "PRAGMA foreign_key_list(tableName)" display the name of the foreign key constraint. For example, For the following table schemas: create table artist(artistid integer primary key, artistname text); create table track(trackid integer,

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
That was exactly my thought. But since it is at a customer's site, I have to prove that its their virus scanner that is causing the problems. On 2/8/2011 1:17 PM, Jim Morris wrote: > > Could a backup or virus scanning software be locking the database? > > On 2/8/2011 10:12 AM, Nathan Biggs

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Simon Slavin
On 8 Feb 2011, at 6:12pm, Nathan Biggs wrote: > I haven't tried that, but if we stop the application then restart it, > everything works again. That is until we get another Disk I/O error > which happens the next day. > I'm wondering if the virus scanner is blocking the database write. Just

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Jim Morris
Could a backup or virus scanning software be locking the database? On 2/8/2011 10:12 AM, Nathan Biggs wrote: > I haven't tried that, but if we stop the application then restart it, > everything works again. That is until we get another Disk I/O error > which happens the next day. > I'm wondering

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Teg
Hello Nathan, I'd install "Procmon" set it to filter just on the problem file (and journal files) and let the software run. When you get an error, you should see the details listed in procmon". C Tuesday, February 8, 2011, 1:12:48 PM, you wrote: NB> I haven't tried that, but if we stop the

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
I haven't tried that, but if we stop the application then restart it, everything works again. That is until we get another Disk I/O error which happens the next day. I'm wondering if the virus scanner is blocking the database write. On 2/8/2011 1:03 PM, Simon Slavin wrote: > > On 8 Feb 2011,

Re: [sqlite] Disk I/O Error

2011-02-08 Thread Simon Slavin
On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote: > Once a day, not at the same time, we are getting a disk I/O error from > our application using SQLite. If you try to duplicate the database file do you get any kind of error then ? If not, use the command-line tool to run an integrity check:

[sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
Once a day, not at the same time, we are getting a disk I/O error from our application using SQLite. Is there a more detailed way of determining the reason of the Disk I/O error. We are running on Windows XP. There is plenty of space on the disk (> 140GB available). Thanks

Re: [sqlite] Regarding "Manual Control Of Query Plans"

2011-02-08 Thread Simon Slavin
On 8 Feb 2011, at 4:22pm, Sven L wrote: > Thank you very much for your detailed explanation! You're welcome. I've actually never had to think out this feature of SQLite before, so it was interesting for me too. I hope Richard or the rest of the team will correct me if I got anything wrong.

Re: [sqlite] Regarding "Manual Control Of Query Plans"

2011-02-08 Thread Sven L
Thank you very much for your detailed explanation! I will comment out my calls to ANALYZE, and see how my software performs. The reason why I added it in the first place is that users are allowed to create their own queries, and since not all of them are SQL experts, I wanted the engine to be

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dennis Geldhof
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Dan Kennedy > Sent: dinsdag 8 februari 2011 14:51 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] database disk image is malformed 3.7.x > > Then run the resulting

Re: [sqlite] Regarding "Manual Control Of Query Plans"

2011-02-08 Thread Simon Slavin
On 8 Feb 2011, at 2:39pm, Sven L wrote: > Is it reasonable to guess that sqlite_stat* are used only for NATURAL JOINs > and other not-so-obvious joins? No. Consider this: SELECT * FROM myTable WHERE a=104 AND b=213 Suppose there are two indexes on myTable: one indexes only column a, and the

Re: [sqlite] Surprising profiling results

2011-02-08 Thread Nico Williams
On Tue, Feb 8, 2011 at 9:12 AM, Ian Hardingham wrote: > Wow - changing to that in combination with indexes on player1 and > player2 has dropped the time to 25 and 10 - an incredible improvement. > > I'll need to get my head around using combinations of queries which each > only

Re: [sqlite] Surprising profiling results

2011-02-08 Thread Ian Hardingham
Hi Igor, Wow - changing to that in combination with indexes on player1 and player2 has dropped the time to 25 and 10 - an incredible improvement. I'll need to get my head around using combinations of queries which each only use indexed columns. Thanks, Ian On 08/02/2011 13:48, Igor Tandetnik

Re: [sqlite] Regarding "Manual Control Of Query Plans"

2011-02-08 Thread Sven L
Is it reasonable to guess that sqlite_stat* are used only for NATURAL JOINs and other not-so-obvious joins? In my software, the database sometimes grows up to 1-2 GB immediately due to the nature of the application. Hence, the guidelines for the ANALYZE command do not suffice for me. "Do it

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dan Kennedy
On 02/08/2011 08:26 PM, Dennis Geldhof wrote: >> -Original Message- >> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >> boun...@sqlite.org] On Behalf Of Dan Kennedy >> Sent: dinsdag 8 februari 2011 12:33 >> To: sqlite-users@sqlite.org >> Subject: Re: [sqlite] database disk

Re: [sqlite] Surprising profiling results

2011-02-08 Thread Igor Tandetnik
Ian Hardingham wrote: > I was attempting to optimise this query this weekend: > > SELECT * FROM multiturnTable WHERE (player1 LIKE '?' OR player2 LIKE > '?') AND (complete=0 OR p1SubmitScore=0 OR p2SubmitScore=0) AND > p1Declined=0 AND p2Declined=0; > > What I'll be trying next

[sqlite] Surprising profiling results

2011-02-08 Thread Ian Hardingham
I was attempting to optimise this query this weekend: SELECT * FROM multiturnTable WHERE (player1 LIKE '?' OR player2 LIKE '?') AND (complete=0 OR p1SubmitScore=0 OR p2SubmitScore=0) AND p1Declined=0 AND p2Declined=0; multiturnTable has about 70,000 rows and has no explicit indexes. I was

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dennis Geldhof
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Dan Kennedy > Sent: dinsdag 8 februari 2011 12:33 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] database disk image is malformed 3.7.x > > We're very interested in

Re: [sqlite] Speed up count(distinct col)

2011-02-08 Thread BareFeetWare
You have: CREATE TABLE movies(movie_id INTEGER, title TEXT, unique(movie_id)); CREATE TABLE tags(movie_id INTEGER, tag TEXT, unique(movie_id,tag)); You can solve your problem, using pure SQL. No need to resort to the application layer. Just execute the SQL transaction below. It takes care of

Re: [sqlite] Blob in the callback of sqlite3_exec

2011-02-08 Thread Ray
Thanks. You remind me those NULs :) On Feb 8, 12:12 am, "Igor Tandetnik" wrote: > Ray wrote: > > What's the actual type of blob in the callback of sqlite3_exec? Is it > > string or remains binary? > > Bytes are reported as-is, with an added zero

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dan Kennedy
On 02/08/2011 06:00 PM, Dennis Geldhof wrote: > Hi all, > > > > I experienced some strange behavior between different versions of > sqlite. Our application uses the System.Data.Sqlite wrapper > (http://sqlite.phxsoftware.com/) which is on sqlite version 3.6.23.1, > but the tools we use to view the

[sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dennis Geldhof
Hi all, I experienced some strange behavior between different versions of sqlite. Our application uses the System.Data.Sqlite wrapper (http://sqlite.phxsoftware.com/) which is on sqlite version 3.6.23.1, but the tools we use to view the database are on sqlite version 3.7.4. In the application