Re: [sqlite] "Common Table Expression"

2013-12-27 Thread David de Regt
RSmith - I said "often", not "entirely". :) Discussion about how to better use SQLite for an already working implementation or for a proposed implementation is a great and proper use of the list. Coming onto the list and asking how to store a simple branch-and-leaf tree structure in SQL is

Re: [sqlite] "Common Table Expression"

2013-12-26 Thread David de Regt
Sorry, this struck a bit of a sore spot with me, so I apologize for the small rant... Feel free to completely ignore it. CTEs are important for two reasons: 1. Simplification of query syntax. One can argue that this isn't terribly important in a system designed as an embedded database, rather

Re: [sqlite] Is there

2013-12-17 Thread David de Regt
Maybe just use a connection list of some sort in a table? When you connect, insert (and clear out any others from your client in case it crashed before), when you disconnect, remove it. Pretty sure there's not a way to find open connections because the sqlite api closes and opens the DB with

Re: [sqlite] SQL_STATIC unterminated strings, and sqlite3_result_text

2013-12-15 Thread David de Regt
Sorry to threadjack here, but this made me think of something... Does this mean that sqlite3_column_text always makes a copy of the string to put a null terminator on the end? My ORM uses std::strings in UTF8 everywhere, so does that mean it would be quite a bit faster to pull strings out

Re: [sqlite] What takes the most time

2013-11-13 Thread David de Regt
You'll need to use threading if you want to make queries abortable. Another thread will need to call sqlite3_interrupt(handle) to abort it. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of L. Wood Sent: Wednesday, November

[sqlite] Interesting bug with sqlite3_limit and SQLITE_LIMIT_VARIABLE_NUMBER?

2013-11-04 Thread David de Regt
I just ran into a possible bug when trying to add some debugging ability to my app. I have a global #define for the max # of bindable columns (to tweak for perf/statement cache/etc.), and I wanted to make it so I could set it to 0 to basically disable my statement preparation code, so that I

Re: [sqlite] MATCH with punctuation in parenthesis causing error

2013-11-03 Thread David de Regt
, David de Regt <dav...@mylollc.com> wrote: > I've worked around this issue a separate way, but I'd like to > understand what went wrong in the first place here. I have an FTS3 > table, and if I query with the following: > > SELECT * FROM table WHERE keywords MATCH '(blah!)' &g

[sqlite] MATCH with punctuation in parenthesis causing error

2013-11-03 Thread David de Regt
I've worked around this issue a separate way, but I'd like to understand what went wrong in the first place here. I have an FTS3 table, and if I query with the following: SELECT * FROM table WHERE keywords MATCH '(blah!)' I get the following error: malformed MATCH expression:_[(blah!)] If I

[sqlite] Visual Studio 2013 Issue - GetVersionEx deprecated

2013-11-03 Thread David de Regt
A small issue has arisen that the local powers may want to be aware of. In Visual Studio 2013, which uses the Windows 8.1 Platform SDK, they've marked GetVersionEx as deprecated, trying to supercede it through to VerifyVersionInfo and some other hardcoded macros based on that call that the new

Re: [sqlite] Hints for the query planner

2013-09-10 Thread David de Regt
Seconded. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Tuesday, September 10, 2013 3:46 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Hints for the query planner On 10 Sep 2013, at

Re: [sqlite] Query preperation time does not scale linearly with growth of no. of tables

2013-09-06 Thread David de Regt
Mayhaps the CROSS JOIN trick is your friend in this case, if you can be pretty sure of the correct direction of the join order. :) -David -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of James K. Lowden Sent: Friday,

Re: [sqlite] Number of Colum!!!

2013-08-13 Thread David de Regt
The limit of 64 columns for a covered index to work should really go on that page too. :( -David -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Jay A. Kreibich Sent: Tuesday, August 13, 2013 7:19 AM To: General Discussion

Re: [sqlite] Any way to debug database is locked?

2013-07-26 Thread David de Regt
...@sqlite.org] On Behalf Of Simon Slavin Sent: Friday, July 26, 2013 5:53 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Any way to debug database is locked? On 27 Jul 2013, at 1:20am, David de Regt <dav...@mylollc.com> wrote: > Is there any chance that the OS is still

[sqlite] Any way to debug database is locked?

2013-07-26 Thread David de Regt
We have a fairly complicated system of OS mutexes and using exclusive DB transactions to attempt to avoid database locking issues with SQLite. It works great most of the time, but every few days one of our testers randomly runs into a database is locked error. Every time it's been in a

Re: [sqlite] Large Database Windows vs Linux

2013-06-28 Thread David de Regt
It's the kind of useful help like this that makes me love the FOSS movement. -David -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Walter Hurry Sent: Friday, June 28, 2013 5:09 PM To: sqlite-users@sqlite.org Subject: Re:

Re: [sqlite] Large Database Windows vs Linux

2013-06-28 Thread David de Regt
FWIW, with our test and prod implementations, we find between a 3 and 10x (300-1000%) increase in almost all of our query times on Windows NTFS over OSX and iOS systems, depending on the query type. We've done a bunch of testing and can verify it every time. I started a thread on this ~7

Re: [sqlite] Covering Index?

2013-06-04 Thread David de Regt
s) -David -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp Sent: Tuesday, June 4, 2013 7:27 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Covering Index? On Tue, Jun 4, 2013 at 10:16 PM, David de

[sqlite] Covering Index?

2013-06-04 Thread David de Regt
Quick question, SQLites, CREATE TABLE test (col1 text, col2 text, col3 text); CREATE INDEX tindex ON test (col1, col2, col3); explain query plan SELECT * FROM test WHERE col1 = 'a' AND col3 = 'c'; The above returns: SEARCH TABLE test USING COVERING INDEX tindex (col1=?) (~2 rows) Which of

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread David de Regt
data instead of indexes. The only downside to that, I suppose, is that you have to pick the right table when doing the select. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of David de Regt Sent: Wednesday, May 22, 2013 3:07 PM

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread David de Regt
- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of David de Regt Sent: Wednesday, May 22, 2013 2:59 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Max of 63 columns for a covering index to work? Hm. That's a wee bit of an is

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread David de Regt
de Regt <dav...@mylollc.com> wrote: > I'm experimenting with covering indices on one of our larger tables. > > *[many words expressing concern that SQLlite does not use covering > indices on tables with more than 63 colums]...* > > Your observations are correct. If

[sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread David de Regt
I'm experimenting with covering indices on one of our larger tables. I started seeing really inconsistent behavior, and made the following sample setup code that demonstrates it: DROP TABLE IF EXISTS test; CREATE TABLE test( col01 integer,col02 integer,col03 integer,col04 integer,col05

Re: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread David de Regt
On 30/11/12 13:31, David de Regt wrote: > Only possible agent is MSE, MSE is the best behaved. Norton and similar are especially bad. > ... and process monitor doesn't show it eating IO Sadly that rules out easy fixes :-) > I tried changing block size to the native block size and it only

Re: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread David de Regt
) Performance -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30/11/12 09:41, David de Regt wrote: > Is there something ridiculous about the windows file system performance > that hoses sqlite's open/read/write/close transaction cycle? There are multiple possible confounding factors

Re: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread David de Regt
. iOS/OSX (fast) Performance On 30 Nov 2012, at 5:41pm, David de Regt <dav...@mylollc.com> wrote: > Basic query set: > CREATE TABLE test (col1 int, col2 text); > [loop 500 times]: INSERT INTO TEST (col1,col2) VALUES (4,'test4') I read with interest the figures you produc

Re: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread David de Regt
Grumman Information Systems From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of David de Regt [dav...@mylollc.com] Sent: Friday, November 30, 2012 11:41 AM To: General Discussion of SQLite Database Subject: EXT :[sqlite

[sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread David de Regt
Hey all. I've been struggling with a basic perf issue running the same code on Windows vs. iOS and OSX. Basic query set: CREATE TABLE test (col1 int, col2 text); [loop 500 times]: INSERT INTO TEST (col1,col2) VALUES (4,'test4') I'm coding this using the default C amalgamation release and using