Re: [sqlite] SQL query, finding out which row a result is in

2007-04-23 Thread Gilles Roy
On Mon, Apr 23, 2007 at 09:26:53AM -0400, Stephen Oberholtzer wrote: On 4/22/07, Gilles Roy <[EMAIL PROTECTED]> wrote: Given a arbitrary statement, I need to find out which row a specific result is in, as efficiently as possible. The arbitrary statement can order the results any way it wants.

Re: [sqlite] Submitting patches?

2007-04-23 Thread Liam Healy
On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: (drh makes a mental note to improve the formatting of the contributed code section. The original table format seems a bit cluttered...) As long as you may be making a change, may I request a feature if it's not too much trouble? It

Re: [sqlite] Fortran 95 Language Bindings

2007-04-23 Thread Liam Healy
Arjen, Thank you for attentive maintenance and development on this valuable interface. On 4/23/07, Arjen Markus <[EMAIL PROTECTED]> wrote: Liam Healy wrote: > Arjen, > > I've taken another look at these bindings, and at my project. For a > variety > of reasons, most not related to the

Re: [sqlite] An explanation?

2007-04-23 Thread Dennis Cote
Marco Bambini wrote: Database is uniformly distributed, I created it ad hoc just for my test (sqlite 3.3.12): Marco, Another way to think of this is that if your database contained random numbers in the range 1-100 for both a and b, then an index on either of those values would allow

Re: [sqlite] An explanation?

2007-04-23 Thread Dennis Cote
Marco Bambini wrote: I know that I can use the ANALYZE command or that I can index both columns. I was making some tests and I found that with one index the query is slower that without any index, so I just trying to understand the reason... I do not want to run it faster, I already know that

Re: [sqlite] Recommended wrapper for Python?

2007-04-23 Thread Gilles Ganault
At 21:14 23/04/2007 +0100, Martin Jenkins wrote: pysqlite implements Python's DBAPI and was integrated into Python. There is another wrapper, APSW, which is thinner and closer to SQLite's C API. Choose whichever you feel most comfortable with. If you choose pysqlite be aware that it will

Re: [sqlite] An explanation?

2007-04-23 Thread Marco Bambini
I know that I can use the ANALYZE command or that I can index both columns. I was making some tests and I found that with one index the query is slower that without any index, so I just trying to understand the reason... I do not want to run it faster, I already know that it is possible.

Re: [sqlite] TRANSACTION

2007-04-23 Thread John Stanton
Thanks for the input and confirming my analysis. I am implementing a remote procedure call capability and keep a library of SQL transactions to be executed by a remote client. Dennis Cote wrote: John Stanton wrote: I am not sure how to proceed with handling multiple SQL statements. Perhaps

Re: [sqlite] Recommended wrapper for Python?

2007-04-23 Thread Martin Jenkins
Gilles Ganault wrote: At 14:40 23/04/2007 +0200, Stef Mientki wrote: I've no experience whatsover, but if I see the list, the top one is the best choice, because it'll be integrated in the standard Python. Thanks. I didn't know SQLite was part of Python 2.5. pysqlite implements Python's

Re: [sqlite] Re: TRANSACTION

2007-04-23 Thread John Stanton
Thanks Igor, much obliged. That fits my application quite elegantly. Igor Tandetnik wrote: John Stanton <[EMAIL PROTECTED]> wrote: I want to store multi-statement SQL to implement an entire transaction in the form - BEGIN statement statement ... COMMIT I can see that

Re: [sqlite] An explanation?

2007-04-23 Thread drh
Marco Bambini <[EMAIL PROTECTED]> wrote: > Yes, I know that it is faster ... I just wonder why with one index > the query is slower that without any index... Probably because most of the entries in your table match the term being indexed. In your case, this likely means that a large fraction

Re: [sqlite] An explanation?

2007-04-23 Thread Dennis Cote
Marco Bambini wrote: As a performance test I created a db with 300,000 records, table is: CREATE TABLE table1 (a INTEGER, b INTEGER) a query like: SELECT * FROM table1 WHERE a=5 AND b=11; takes 0.281 secs. if I add two indexes: CREATE INDEX index1 ON table1(a); CREATE INDEX index2 ON

Re: [sqlite] TRANSACTION

2007-04-23 Thread Dennis Cote
John Stanton wrote: I am not sure how to proceed with handling multiple SQL statements. Perhaps someone has some experiences they would be kind enough to share. I want to store multi-statement SQL to implement an entire transaction in the form - BEGIN statement statement

[sqlite] Re: TRANSACTION

2007-04-23 Thread Igor Tandetnik
John Stanton <[EMAIL PROTECTED]> wrote: I want to store multi-statement SQL to implement an entire transaction in the form - BEGIN statement statement ... COMMIT I can see that sqlite3_prepare has the capability of stepping through a multi statement string but it looks

Re: [sqlite] An explanation?

2007-04-23 Thread Marco Bambini
Yes, I know that it is faster ... I just wonder why with one index the query is slower that without any index... --- Marco Bambini On Apr 23, 2007, at 6:31 PM, P Kishor wrote: On 4/23/07, Marco Bambini <[EMAIL PROTECTED]> wrote: As a performance test I created a db with 300,000 records,

Re: [sqlite] Recommended wrapper for Python?

2007-04-23 Thread Gilles Ganault
At 14:40 23/04/2007 +0200, Stef Mientki wrote: I've no experience whatsover, but if I see the list, the top one is the best choice, because it'll be integrated in the standard Python. Thanks. I didn't know SQLite was part of Python 2.5.

[sqlite] TRANSACTION

2007-04-23 Thread John Stanton
I am not sure how to proceed with handling multiple SQL statements. Perhaps someone has some experiences they would be kind enough to share. I want to store multi-statement SQL to implement an entire transaction in the form - BEGIN statement statement ... COMMIT I can

Re: [sqlite] Submitting patches?

2007-04-23 Thread Dennis Cote
Stephen Oberholtzer wrote: What's the best way to submit patches for SQLite? I looked around on the website and didn't find anything relevant; Google wasn't much help because all I got were pages for *other* projects that used SQLite to maintain their patch databases. Stephen, See the

Re: [sqlite] Submitting patches?

2007-04-23 Thread drh
"Stephen Oberholtzer" <[EMAIL PROTECTED]> wrote: > What's the best way to submit patches for SQLite? I looked around on > the website and didn't find anything relevant; Google wasn't much help > because all I got were pages for *other* projects that used SQLite to > maintain their patch

RE: [sqlite] SQL query, finding out which row a result is in

2007-04-23 Thread Griggs, Donald
Hi Roy, If your statement "X" is represented below by "select ... Order by ..." Then would the following give you what you're looking for?? create temp table Xtab as (select Order by ); select ROWID from xTab where MemberID=4567373; (Without some "order by" clause, by the

[sqlite] Submitting patches?

2007-04-23 Thread Stephen Oberholtzer
What's the best way to submit patches for SQLite? I looked around on the website and didn't find anything relevant; Google wasn't much help because all I got were pages for *other* projects that used SQLite to maintain their patch databases. -- -- Stevie-O Real programmers use COPY CON

Re: [sqlite] An explanation?

2007-04-23 Thread P Kishor
On 4/23/07, Marco Bambini <[EMAIL PROTECTED]> wrote: As a performance test I created a db with 300,000 records, table is: CREATE TABLE table1 (a INTEGER, b INTEGER) a query like: SELECT * FROM table1 WHERE a=5 AND b=11; takes 0.281 secs. if I add two indexes: CREATE INDEX index1 ON table1(a);

Re: [sqlite] SQL query, finding out which row a result is in

2007-04-23 Thread John Stanton
You don't have to read into a memory array. How about just running through your selection with an sqlite3_step and counting the rows? Gilles Roy wrote: On Sun, Apr 22, 2007 at 05:33:43PM -0500, P Kishor wrote: On 4/22/07, Gilles Roy <[EMAIL PROTECTED]> wrote: Given a arbitrary statement,

[sqlite] An explanation?

2007-04-23 Thread Marco Bambini
As a performance test I created a db with 300,000 records, table is: CREATE TABLE table1 (a INTEGER, b INTEGER) a query like: SELECT * FROM table1 WHERE a=5 AND b=11; takes 0.281 secs. if I add two indexes: CREATE INDEX index1 ON table1(a); CREATE INDEX index2 ON table1(b); the same query is

AW: [sqlite] INSTEAD OF Trigger Question

2007-04-23 Thread Sylko Zschiedrich
Thank you! It work's fine.. Sylko -Ursprüngliche Nachricht- Von: Stephen Oberholtzer [mailto:[EMAIL PROTECTED] Gesendet: Montag, 23. April 2007 15:42 An: sqlite-users@sqlite.org Betreff: Re: [sqlite] INSTEAD OF Trigger Question On 4/23/07, Sylko Zschiedrich <[EMAIL PROTECTED]> wrote: >

Re: [sqlite] INSTEAD OF Trigger Question

2007-04-23 Thread Stephen Oberholtzer
On 4/23/07, Sylko Zschiedrich <[EMAIL PROTECTED]> wrote: Hi all, i have a question to "instead of triggers" on views. Following schema: h> That's my current implementation. But with this I can't update the View to 'null' values because the coalesce statement will return the old.values.

Re: [sqlite] SQL query, finding out which row a result is in

2007-04-23 Thread Stephen Oberholtzer
On 4/22/07, Gilles Roy <[EMAIL PROTECTED]> wrote: Given a arbitrary statement, I need to find out which row a specific result is in, as efficiently as possible. The arbitrary statement can order the results any way it wants. Let's say your resultset consists of 3 columns: memberid, lastname,

Re: [sqlite] Recommended wrapper for Python?

2007-04-23 Thread Stef Mientki
Gilles Ganault wrote: Hello I browsed through the archives at Gname, but most threads regarding wrappers for Python date back to 2005. There are several wrappers listed in the wiki (http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers), so I'd like some feedback about which you would

[sqlite] Recommended wrapper for Python?

2007-04-23 Thread Gilles Ganault
Hello I browsed through the archives at Gname, but most threads regarding wrappers for Python date back to 2005. There are several wrappers listed in the wiki (http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers), so I'd like some feedback about which you would recommend to use SQLite from

Re: [sqlite] SQL query, finding out which row a result is in

2007-04-23 Thread Hugh Gibson
> You could do this: > > SELECT COUNT(*) from X where memberid < 4567373 That assumes that you are sorting by memberid, of course... Hugh - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] SQL query, finding out which row a result is in

2007-04-23 Thread Hugh Gibson
> That is what I want to do. I want to know where the memberid is in > the list (imagine the list was a waiting list or something). Is there > not a way to just get the row number back? Is seems inefficient to > have to allocate all of the memory to hold all of the results and > then iterate

[sqlite] INSTEAD OF Trigger Question

2007-04-23 Thread Sylko Zschiedrich
Hi all, i have a question to "instead of triggers" on views. Following schema: -- View -- CREATE VIEW DepartmentHasApp as select UID_Application as UID_Application, UID_Org as UID_Department,

[sqlite] sqlite with hugetlbpage on linux

2007-04-23 Thread prasanth ns
Hi All, Could somebody please answer my questions? - Does sqlite work with hugetlbpage (http://lxr.linux.no/source/Documentation/vm/hugetlbpage.txt) feature on linux? - If not, is anybody working on this? Thanks in advance, Prasanth. __ Do You

Re: [sqlite] Fortran 95 Language Bindings

2007-04-23 Thread Arjen Markus
Liam Healy wrote: Arjen, I've taken another look at these bindings, and at my project. For a variety of reasons, most not related to the sqlite3 Fortran bindings, I have decided to proceed in a different direction. However, on closer examination of the Fortran bindings and other language