[sqlite] Index generation efficiency

2005-07-25 Thread Mathieu Blondel
Hi everyone, I'm using sqlite3 for my project, Nihongo Benkyo, which is a japanese dictionary and learning tool. This program can import data from files in various formats in the sqlite database. Generally speaking, one import does about 500,000 INSERT queries in a single transaction and it i

[sqlite] F.W.A. van Leeuwen is out of the office.

2005-07-25 Thread F.W.A. van Leeuwen
I will be out of the office starting 2005-07-25 and will not return until 2005-08-19. I will respond to your message when I return.

[sqlite] No Timeout during commit?

2005-07-25 Thread R S
Hi, I have 2 process accessing the DB, one reading and the other writing. Often the process reading the DB could take long and could block the other process from committing a bunch of records to the DB. I noticed that when the reader process has the lock and the writer process tries to commit a

[sqlite] problems to install pysqlite

2005-07-25 Thread SKORPIO-INFO
SKORPIO-INFO ha scritto: Accidents!! I do not succeed re-install pysqlite!!! they give always this error to me!! You can help me? p.s. with all the versions, also the previous ones!!

Re: [sqlite] Limit how much data to read

2005-07-25 Thread Kurt Welgehausen
> Where in the documentation that explains how to use the sqlite substr() > function? Go to the SQLite Syntax page, and click on 'expression'.

RE: [sqlite] Limit how much data to read - substr syntax

2005-07-25 Thread Griggs, Donald
Regarding: Where in the documentation that explains how to use the sqlite substr() function? Hi Shawn, >From the main sqlite.org page, take the SYNTAX link, then EXPRESSIONS http://www.sqlite.org/lang_expr.html substr(X,Y,Z) Return a substring of input string X that begins with the Y-th cha

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Jay Sprenkle
> > I cache the items I'm displaying in an STL vector (C++). If the user moves > > to a page where I have no data I load it from the database as needed. I was > > considering loading data in the background in case the user might need it > > since I can predict what they might do relatively easily.

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Kim Bendtsen
> > I cache the items I'm displaying in an STL vector (C++). If the user moves > to a page where I have no data I load it from the database as needed. I was > considering loading data in the background in case the user might need it > since I can predict what they might do relatively easily. Pref

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Kim Bendtsen
Thank you for your thoughts. > You can build the result set into an array, then step through, back and > around the array. > > SQLite already provides this functionality: > http://www.sqlite.org/capi3ref.html#sqlite3_get_table Having the entire result in memory would be an easy solution but unfo

Re: [sqlite] Limit how much data to read

2005-07-25 Thread Shawn Walker
Where in the documentation that explains how to use the sqlite substr() function? Cory Nelson wrote: Try the substr() function On 7/25/05, Shawn Walker <[EMAIL PROTECTED]> wrote: Is there a way to tell sqlite to read up to X bytes? For example, there are some data that can be quite large, b

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
> SQLite Version 3.2.2. > Is this a bug, or is my SQL that bad? > Query 1: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But when I do this, SQLite locks out (Command line interface, and PHP5)

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Jay Sprenkle
On 7/25/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Any thoughts/brainstorming would be great from anyone :) > > Personally I don't have much experience with programming a database and > the theory in it. But I suppose that in order to be able to go backward, > the results already iterated

Re: [sqlite] Multi-threading.

2005-07-25 Thread Jay Sprenkle
> Computer _Science_ is just that: Science. It's not opinion. What they taught me at university was the current collection of "best practices" for solving problems. "Here's a common problem, here are the known good algorithms for solving it. Here are the techniques we use for creating 'good' progr

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Jay Sprenkle
> SQLite Version 3.2.2. > Is this a bug, or is my SQL that bad? > Query 1: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But when I do this, SQLite locks out (Command line interface, and PHP5) >

RE: [sqlite] Multi-threading.

2005-07-25 Thread Steve O'Hara
Hi Ben, You're right about the native vs pseudo threads-own schedule issue and in fact this is exactly how most Java Virtual Machines handle it. The JVM's that support native threads contain a runtime time switch that allows you to turn it on and off - this means that your application can be bui

Re: [sqlite] Limit how much data to read

2005-07-25 Thread Cory Nelson
Try the substr() function On 7/25/05, Shawn Walker <[EMAIL PROTECTED]> wrote: > Is there a way to tell sqlite to read up to X bytes? For example, there > are some data that can be quite large, but I don't need all of them, > just a little bit of it to show the user some of the data and they can >

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
Might I suggest the following -- make your query in steps, and note where it actually starts slowing down. For example, Step 1. SELECT COUNT(*) FROM t1 (took a fraction of a pico second... good) Step 2. SELECT COUNT(*) FROM t1 WHERE t1.c1 = 'c1' (took a couple of fractions of a pico second.

[sqlite] Limit how much data to read

2005-07-25 Thread Shawn Walker
Is there a way to tell sqlite to read up to X bytes? For example, there are some data that can be quite large, but I don't need all of them, just a little bit of it to show the user some of the data and they can select that data to get the rest of the data from the DB.

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Puneet Kishor
On Jul 25, 2005, at 6:06 AM, David Fowler wrote: On 2005-07-25 at 10:58:04 [+0200], David Fowler .. === Thanks for the pointer Charlie, but I was only using * for my example, and I normaly use fully named columns (table.column) when writing quer

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
I think if you try this with MySQL MyISAM you will have the same result and I think this is to do with the SELECT * I remember I used to have something similar back in the days when I tried MySQL. Charlie == I just tried adding extra conditions in the

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Charlie Clark
On 2005-07-25 at 14:51:13 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > Well the query isn't that strange, I have 3 values that need matching > per-record returned, all in different tables (takes care of 3 tables) the > actual data I want is stored in another related table, and 2 of the valu

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Christian Smith
On Sun, 24 Jul 2005, Kim Bendtsen wrote: >Hi There > >After executing a query I get the result back and can traverse it using >sqlite3_step. This is fine for most systems, however for what I wish to use >SQLite for, I would need something similar to stepForward, stepBackward, >stepToFirst, stepToL

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
On 2005-07-25 at 13:06:42 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > SELECT count(*) FROM table1 > INNER JOIN table2 ON (table1.id = table2.rel_id) > INNER JOIN table3 ON (table3.rel_id = table2.id) > INNER JOIN table4 ON (table3.id = table4.rel_id) > INNER JOIN table5 ON (table5.rel_id =

Re: [sqlite] Multi-threading.

2005-07-25 Thread Ben Clewett
Steve O'Hara wrote: I think the point about multi-threaded apps is not that there might be a few instances where they are useful, but how easy is it to debug and support them and is it worth the price for a little more concurrency? Good point. The ones I have used are terrible. I hope things

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread kim
> Hi There > > After executing a query I get the result back and can traverse it using > sqlite3_step. This is fine for most systems, however for what I wish to > use > SQLite for, I would need something similar to stepForward, stepBackward, > stepToFirst, stepToLast. > > The application where I'm

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Charlie Clark
On 2005-07-25 at 13:06:42 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > SELECT count(*) FROM table1 > INNER JOIN table2 ON (table1.id = table2.rel_id) > INNER JOIN table3 ON (table3.rel_id = table2.id) > INNER JOIN table4 ON (table3.id = table4.rel_id) > INNER JOIN table5 ON (table5.rel_id =

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
On 2005-07-25 at 10:58:04 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > Thanks Charlie, thats exactly how I should be doing it. I would imagine > there are some performance benefits from doing it this way too. Now I've > just got to make it work for my select that involves six not two tables!

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Charlie Clark
On 2005-07-25 at 10:58:04 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > Thanks Charlie, thats exactly how I should be doing it. I would imagine > there are some performance benefits from doing it this way too. Now I've > just got to make it work for my select that involves six not two tables

RE: [sqlite] Multi-threading.

2005-07-25 Thread Steve O'Hara
I think the point about multi-threaded apps is not that there might be a few instances where they are useful, but how easy is it to debug and support them and is it worth the price for a little more concurrency? In my experience, most debugging IDE's can't handle multiple threads and actually tur

Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames

2005-07-25 Thread Edwin Knoppert
Just tested, seems to work :) Thanks! - Original Message - From: "Nuno Lucas" <[EMAIL PROTECTED]> To: Sent: Monday, July 25, 2005 10:38 AM Subject: Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames I'm not understanding what's the problem here. I always get the column na

Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames

2005-07-25 Thread Edwin Knoppert
That's good news! Thanks, will try. :) - Original Message - From: "Nuno Lucas" <[EMAIL PROTECTED]> To: Sent: Monday, July 25, 2005 10:38 AM Subject: Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames I'm not understanding what's the problem here. I always get the column

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
On 2005-07-25 at 10:15:14 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But when I do this, SQLite locks ou

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Charlie Clark
On 2005-07-25 at 10:15:14 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But when I do this, SQLite locks out (Command line interface, and PHP5)

Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames

2005-07-25 Thread Nuno Lucas
I'm not understanding what's the problem here. I always get the column names even on empty result sets (so I can show them in a grid header). I confess I haven't been using the latest sqlite versions to be sure it is still returned, but isn't this what you want? My guess is that maybe you are us

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
this statement has an extra ; which may be the error. Another thought, when quoting string literals, it is better to use single quotes('), since double quotes(") means identifier --column name-- first, string literal second. John == Thanks for the very fa

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread John LeSueur
David Fowler wrote: SQLite Version 3.2.2. Is this a bug, or is my SQL that bad? Query 1: SELECT * FROM table1, table2 WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); This query works perfectly, can't fault it. But when I do this, SQLite locks out (Command line interface, an

[sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
SQLite Version 3.2.2. Is this a bug, or is my SQL that bad? Query 1: SELECT * FROM table1, table2 WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); This query works perfectly, can't fault it. But when I do this, SQLite locks out (Command line interface, and PHP5) Query 2: SELEC

Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames

2005-07-25 Thread Edwin Knoppert
I might be mistaken but you should never expect row-0 for data. What i meant is that the fieldnames are present when there is data. And not when there is no data. In either case, row-0 should never be threated as data row. So one can not expect data in there. The point is when there is data, SQLi

Re: [sqlite] Multi-threading.

2005-07-25 Thread Ben Clewett
Dear Mrs Brisby, Thanks for your passionate replies to my original posting. You have much information here. It's obvious I don't know everything about threading. I like what you say about computer science being a Science. This is exactly my point. A science is a collection of theories wh