Re: [sqlite] Expr.iTable question

2006-04-16 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > > > What is the recommended way to match a TK_COLUMN Expr from > > a Select's pEList with its corresponding Select.pSrc > > SrcList_item? > > > > Do you forsee any technical problem with recursively descending > > the en

Re: [sqlite] backwards compatibility

2006-04-16 Thread Michael P. Soulier
On 16/04/06 [EMAIL PROTECTED] said: > 3.3.5 is backwards compatible. It will read and write a 3.2.2 > database file. But 3.2.2 is not forwards compatible to 3.3.5. > > SQLite 3 will always be backwards compatible. Forwards compatibility > is a goal but is not guaranteed. Ah, right. > If you

Re: [sqlite] backwards compatibility

2006-04-16 Thread drh
"Michael P. Soulier" <[EMAIL PROTECTED]> wrote: > Hello, > > I just got a nasty surprise. I installed an sqlite 3.3.5 .dll on windows with > pysqlite2, and I used an application to create a database file. I then scp'd > the file home to my linux box where I have sqlite 3.2.2 installed, and I got >

Re: [sqlite] backwards compatibility

2006-04-16 Thread Derrell . Lipman
"Michael P. Soulier" <[EMAIL PROTECTED]> writes: > Hello, > > I just got a nasty surprise. I installed an sqlite 3.3.5 .dll on windows with > pysqlite2, and I used an application to create a database file. I then scp'd > the file home to my linux box where I have sqlite 3.2.2 installed, and I got

[sqlite] backwards compatibility

2006-04-16 Thread Michael P. Soulier
Hello, I just got a nasty surprise. I installed an sqlite 3.3.5 .dll on windows with pysqlite2, and I used an application to create a database file. I then scp'd the file home to my linux box where I have sqlite 3.2.2 installed, and I got this: sqlite> .tables Error: unsupported file format Ouch

Re: [sqlite] Expr.iTable question

2006-04-16 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > > What is the recommended way to match a TK_COLUMN Expr from > a Select's pEList with its corresponding Select.pSrc > SrcList_item? > > Do you forsee any technical problem with recursively descending > the entire parse tree and calling sqlite3SelectReso

Re: [sqlite] Expr.iTable question

2006-04-16 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > Given an arbitrary SELECT in a parse tree that has been > > resolved via sqlite3SelectResolve, and assuming that > > Expr.op==TK_COLUMN does Expr.iTable always yield the > > correct index into the Expr.pTab array in the sam

Re: [sqlite] Does Substr() use index?

2006-04-16 Thread Kurt Welgehausen
Paul Gaspar <[EMAIL PROTECTED]> wrote: > Hello, just a short question: Does this use the index on f > > select * from t where SUBSTR(f,1,1) = 'a' > > so that it is an alternative for > > select * from t where ( f >= 'a' and f < 'b' ) > > > Thanks a lot > > Paul No, but you can read about

Re: AW: Re[2]: [sqlite] MMAP

2006-04-16 Thread John Stanton
Michael Ruck wrote: My experience differs on this one. When processing large amounts of data with a processing function, which takes longer than the I/O using a mapped file is faster than sequential I/O, as the Windows memory manager and caching system will pull in the I/O pages asynchronously. A

[sqlite] Acquiring a PENDING lock

2006-04-16 Thread Tito Ciuro
Hello, As stated in the documentation I see that: A deferred transaction starts without a lock and obtains a SHARED lock on the first read and the first write operation creates a RESERVED lock. An immediate acquires a RESERVED lock as soon as the BEGIN command is executed, without waiti

[sqlite] Does Substr() use index?

2006-04-16 Thread Paul Gaspar
Hello, just a short question: Does this use the index on f select * from t where SUBSTR(f,1,1) = 'a' so that it is an alternative for select * from t where ( f >= 'a' and f < 'b' ) Thanks a lot Paul

Re: [sqlite] Is it safe to read or write a table while being indexed?

2006-04-16 Thread Tito Ciuro
On 16/04/2006, at 3:52, [EMAIL PROTECTED] wrote: Tito Ciuro <[EMAIL PROTECTED]> wrote: - Does SQLite acquire an EXCLUSIVE lock when indexing? Yes - If I'm not mistaken, an EXCLUSIVE lock does not stop other readers from accessing the database. You are mistaken. An EXCLUSIVE lock means t

Re: [sqlite] Expr.iTable question

2006-04-16 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > Given an arbitrary SELECT in a parse tree that has been > resolved via sqlite3SelectResolve, and assuming that > Expr.op==TK_COLUMN does Expr.iTable always yield the > correct index into the Expr.pTab array in the same Expr > struct? > No. When Expr.op

Re: [sqlite] Selecting a random row from a table

2006-04-16 Thread Thomas Chust
On Sun, 16 Apr 2006, [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: [...] I cannot think of a more efficient way to do this if you require each output to have equal probability. If you do not need each string to have exactly the same probability, however, you could do this: SELECT str

[sqlite] Expr.iTable question

2006-04-16 Thread Joe Wilson
Given an arbitrary SELECT in a parse tree that has been resolved via sqlite3SelectResolve, and assuming that Expr.op==TK_COLUMN does Expr.iTable always yield the correct index into the Expr.pTab array in the same Expr struct? i.e., is this valid? // assume Select.pEList->a[c].pExpr->op == TK

Re: [sqlite] Selecting a random row from a table

2006-04-16 Thread Derrell . Lipman
[EMAIL PROTECTED] writes: > Thomas Chust <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I have a table of strings and integer primary keys from which I would like >> to retrieve a string at random. The best solution I could think of was to >> first do a >> SELECT count(id) FROM strings; >> and

Re: [sqlite] Selecting a random row from a table

2006-04-16 Thread Thomas Chust
On Sun, 16 Apr 2006, [EMAIL PROTECTED] wrote: Thomas Chust <[EMAIL PROTECTED]> wrote: Hello, I have a table of strings and integer primary keys from which I would like to retrieve a string at random. [...] I cannot think of a more efficient way to do this if you require each output to have e

AW: Re[2]: [sqlite] MMAP

2006-04-16 Thread Michael Ruck
My experience differs on this one. When processing large amounts of data with a processing function, which takes longer than the I/O using a mapped file is faster than sequential I/O, as the Windows memory manager and caching system will pull in the I/O pages asynchronously. At least on Windows I'd

Re[2]: [sqlite] MMAP

2006-04-16 Thread Teg
In my experience under windows, using memory mapped files is no faster than opening and reading the file into memory then processing it. The limiting factor is the disk drives. I use both methods and the choice of method is always a tossup. If the API I'm using will accept an entire buffer for the

Re: [sqlite] MMAP

2006-04-16 Thread John Stanton
John Stanton wrote: > I wonder if members can help me with some advice. I have a program > which is a multi-threaded application server with Sqlite embedded which > runs on Unix and Windows. For an i/o buffer per thread I have the idea > of using a mmap'd file so that it can be transferred using

Re: [sqlite] what is faster?

2006-04-16 Thread drh
"Cesar David Rodas Maldonado" <[EMAIL PROTECTED]> wrote: > any one can answer me? > > On 4/15/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: > > > > Hello > > > > I have a software that uses four tables. > > > > that's ok.. but i wanna know if is faster if i use for every table a > >

Re: [sqlite] Selecting a random row from a table

2006-04-16 Thread drh
Thomas Chust <[EMAIL PROTECTED]> wrote: > Hello, > > I have a table of strings and integer primary keys from which I would like > to retrieve a string at random. The best solution I could think of was to > first do a > SELECT count(id) FROM strings; > and then a > SELECT string FROM stri

Re: [sqlite] MMAP

2006-04-16 Thread drh
John Stanton <[EMAIL PROTECTED]> wrote: > I wonder if members can help me with some advice. I have a program > which is a multi-threaded application server with Sqlite embedded which > runs on Unix and Windows. For an i/o buffer per thread I have the idea > of using a mmap'd file so that it ca

Re: [sqlite] How to force to block sqlite file, while my conecction is open !

2006-04-16 Thread drh
"=?ISO-8859-1?Q?Edwin_Hern=E1n_Barrios_N=FA=F1ez?=" <[EMAIL PROTECTED]> wrote: > Hi everybody > > this is my fist message on this list. > > Well, i know that my subject sounds a little stupid, by the way > sqlite3 evolution trys to performe better ACID. But i want to force > blocking the db fil

Re: [sqlite] Is it safe to read or write a table while being indexed?

2006-04-16 Thread drh
Tito Ciuro <[EMAIL PROTECTED]> wrote: > Hello, > > I was wondering whether it is safe to read or write a table while > being indexed. Here's a scenario: for batch imports, it's sometimes > better to DROP the indexes, do the INSERTs and then recreate the > relevant indexes. Indexing may take