Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread P Kishor
On 10/8/08, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > "P Kishor" <[EMAIL PROTECTED]> wrote in > message > > news:[EMAIL PROTECTED] > > > Imagine a db where the column 'foo' that you are querying against has > > a different value for every single row. What possible good an index > > would do?

Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread Igor Tandetnik
"P Kishor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Imagine a db where the column 'foo' that you are querying against has > a different value for every single row. What possible good an index > would do? It would let you find a row with a specific value in this column in logN

Re: [sqlite] END TRANSACTION failed with "database is locked"

2008-10-08 Thread Manoj M
Hi, Thanks for your replies. Actually I have only one thread writing to the table and there can be 'n' number of threads reading the table. I am not yet found why this "database locked" error came in my application. Since the database is locked even "End TRANSACTION" also won't help, right? I

Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread P Kishor
On 10/8/08, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > "P Kishor" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] > > > On 10/8/08, James Pringle <[EMAIL PROTECTED]> > > wrote: > > >> SELECT lat, lon, depth FROM hydro WHERE depth>= 49.01 AND depth > >> <= 50.99 > >> > >>

Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread Igor Tandetnik
"P Kishor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/8/08, James Pringle <[EMAIL PROTECTED]> > wrote: >> SELECT lat, lon, depth FROM hydro WHERE depth>= 49.01 AND depth >> <= 50.99 >> >> It selects and returns the records in 82 seconds. I wished to >> improve on

Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread P Kishor
On 10/8/08, James Pringle <[EMAIL PROTECTED]> wrote: > Hi- > > I am new to sqlite, and am having a puzzling problem. I have read > that adding an INDEX to a sqlite table can never make a SELECT > statement slower. However, in my case, it seems to be making the > select statement an order of

Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread Stephen Woodbridge
James, I'm not sure I can answer your questions about speed issues other than to suggest the you read up on the rtree index which is designed for this type of query and should be extremely fast. -Steve James Pringle wrote: > Hi- > > I am new to sqlite, and am having a puzzling problem. I

Re: [sqlite] from access to sqlite

2008-10-08 Thread Olaf Schmidt
"Fabio Stranieri" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > The program is write in vb6. The original statement with access was: > > rsParam.Open "SELECT * FROM " & nome_tab & " WHERE [data_ora] BETWEEN #" & > Format(ieri_inizio, "/mm/dd hh:nn:ss") & "# and #" &

[sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-08 Thread James Pringle
Hi- I am new to sqlite, and am having a puzzling problem. I have read that adding an INDEX to a sqlite table can never make a SELECT statement slower. However, in my case, it seems to be making the select statement an order of magnitude slower, which is not what I wanted! What could be going

Re: [sqlite] from access to sqlite

2008-10-08 Thread P Kishor
On 10/8/08, Fabio Stranieri <[EMAIL PROTECTED]> wrote: > The program is write in vb6. The original statement with access was: > > rsParam.Open "SELECT * FROM " & nome_tab & " WHERE [data_ora] BETWEEN #" & > > Format(ieri_inizio, "/mm/dd hh:nn:ss") & "# and #" & Format(ieri_fine, > >

[sqlite] from access to sqlite

2008-10-08 Thread Fabio Stranieri
The program is write in vb6. The original statement with access was: rsParam.Open "SELECT * FROM " & nome_tab & " WHERE [data_ora] BETWEEN #" & Format(ieri_inizio, "/mm/dd hh:nn:ss") & "# and #" & Format(ieri_fine, "/mm/dd hh:nn:ss") & "# ORDER BY [data_ora];", cnAdoCom, adOpenStatic,

Re: [sqlite] getting data by the column name.

2008-10-08 Thread P Kishor
On 10/8/08, Tim Streater <[EMAIL PROTECTED]> wrote: > At 14:56 -0400 08/10/08, Igor Tandetnik wrote: > >Shaun R. <[EMAIL PROTECTED]> wrote: > >> Anybody help me out here, trying to grab column info based on the > >> columns name. Examples i keep seeing people seam to use the colunm > >>

Re: [sqlite] getting data by the column name.

2008-10-08 Thread Igor Tandetnik
Tim Streater <[EMAIL PROTECTED]> wrote: > At 14:56 -0400 08/10/08, Igor Tandetnik wrote: >> Shaun R. <[EMAIL PROTECTED]> >> wrote: >>> Anybody help me out here, trying to grab column info based on the >>> columns name. Examples i keep seeing people seam to use the colunm >>> number but cant

Re: [sqlite] getting data by the column name.

2008-10-08 Thread Tim Streater
At 14:56 -0400 08/10/08, Igor Tandetnik wrote: >Shaun R. <[EMAIL PROTECTED]> wrote: >> Anybody help me out here, trying to grab column info based on the >> columns name. Examples i keep seeing people seam to use the colunm >> number but cant you access these values by the name? > >Not in

Re: [sqlite] getting data by the column name.

2008-10-08 Thread Igor Tandetnik
Shaun R. <[EMAIL PROTECTED]> wrote: > Anybody help me out here, trying to grab column info based on the > columns name. Examples i keep seeing people seam to use the colunm > number but cant you access these values by the name? Not in general. Consider: select 1, 2, 3*5; What do you think the

Re: [sqlite] from access to sqlite

2008-10-08 Thread Timothy A. Sawyer
With Access, dates have to be surrounded by # and the date format has to be compatible with not only the language you are using but SQL as well. I recommend checking the SQLite docs on acceptable date formats as I have done this with success --Original Message-- From: Fabio Stranieri

Re: [sqlite] Exporting to MySQL?

2008-10-08 Thread Kees Nuyt
On Wed, 08 Oct 2008 13:14:43 +0200, Gilles Ganault <[EMAIL PROTECTED]> wrote in General Discussion of SQLite Database : >Hello > >I'm no MySQL expert, and am having some syntax errors when trying to >export data from SQLite 3 into MySQL 5. What's the error number and

[sqlite] getting data by the column name.

2008-10-08 Thread Shaun R.
Anybody help me out here, trying to grab column info based on the columns name. Examples i keep seeing people seam to use the colunm number but cant you access these values by the name? int main(void) { char myname[50]; sqlite3 *db; sqlite3_stmt *plineInfo = 0;

[sqlite] from access to sqlite

2008-10-08 Thread Fabio Stranieri
I'm trying to replace db access from my vb6 program to sqlite. But this query no work "SELECT * FROM " & nome_tab & " WHERE data_ora BETWEEN " & Format(ieri_inizio, "/mm/dd hh:nn:ss") & " and " & Format(ieri_fine, "/mm/dd hh:nn:ss") & " ORDER BY data_ora" where ieri = Date - 1

Re: [sqlite] Record locking

2008-10-08 Thread Ken
I don't think sqlite is meant to be used that way. The locking is at the database level or in the case of "shared_cache" mode the locks are held at the table level. So locking is pretty much nothing or everything approach. If you look at the journal design you'll see it applies to the entire

Re: [sqlite] END TRANSACTION failed with "database is locked"

2008-10-08 Thread Alexandre Courbot
> I am executing some operations in a loop and all the operations are wrapped > inside a transaction. During one iteration the "END TRANSACTION" returned > with an error "database is locked". Since this is in a loop my next request > to "BEGIN TRASACTION" failed with "cannot start a transaction

[sqlite] END TRANSACTION failed with "database is locked"

2008-10-08 Thread Manoj Marathayil
Hi, I am executing some operations in a loop and all the operations are wrapped inside a transaction. During one iteration the "END TRANSACTION" returned with an error "database is locked". Since this is in a loop my next request to "BEGIN TRASACTION" failed with "cannot start a transaction within

Re: [sqlite] sqlite on flash devices

2008-10-08 Thread Paul
We're using linux. Data loss is not critical. If anything is lost due to unexpected power downs, we can rebuild it and add it to the database at a later stage. Apart from using :memory: another idea is to use linux ramfs and periodically copy this to flash. The other thing I'm assuming is to

[sqlite] Exporting to MySQL?

2008-10-08 Thread Gilles Ganault
Hello I'm no MySQL expert, and am having some syntax errors when trying to export data from SQLite 3 into MySQL 5. Before I dive into MySQL's documentation, does someone know how I should rewrite this type of SQL to keep MySQL happy? BEGIN TRANSACTION; CREATE TABLE dummy (id TEXT PRIMARY KEY NOT

[sqlite] Random errors

2008-10-08 Thread rrrado2
Hi, my post is quit long so I hope somebody will read to end :) I've wrote about my problem before but I still cannot find a solution. My windows app is using sqlite, it is compiled using VS 2005. I've tried more sqlite versions, including 3.6.3. I've tried also to compile sqlite static