Re: [sqlite] insertion time

2006-10-23 Thread Lloyd
Hi, When this 3M inserts are performed, it takes 130 more seconds compared to the actual application running time. The actual application run time is 20 seconds but when this 3M inserts are performed it takes 150 seconds. Is there any way to reduce the time ? Thnaks, Lloyd. On Mon,

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Dennis Cote
[EMAIL PROTECTED] wrote: There is good reason for this, actually. And that pretty definitively answers the question of whether or not this is a bug. :-) Dennis Cote - To unsubscribe, send email to [EMAIL

Re: [sqlite] database corrouption during power failure

2006-10-23 Thread Dennis Cote
jayanth KP wrote: But how do we read the current synchronous value using C interface. Plz reply. Jayanth, Try this: sqlite3_stmt* s; sqlite3_prepare(db, "PRAGMA SYNCHRONOUS", -1, , NULL); sqlite3_step(s); int sync = sqlite3_column_int(s, 1); sqlite3_finalize(s);

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Andy Ross
D. Richard Hipp wrote: > Have you looked at the TCL bindings? The above would be > > db eval {select * from X where Y=$parameter} {... code here ...} I do have a wrapper that uses a hash literal for exactly this (although in practice I find it actually easier to read a bunch of positional

Re: [sqlite] Re: bind with select?

2006-10-23 Thread Jay Sprenkle
On 10/23/06, Dave Dyer <[EMAIL PROTECTED]> wrote: You don't appear to be using BIND in the manner I was hoping for. You're using BIND to replace variables in the query. I want to use BIND (or something like it) eliminate the need for callback functions to consume the results of a select.

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread drh
Andy Ross <[EMAIL PROTECTED]> wrote: > > > SQLite takes the approach of always making every BLOB larger than > > every TEXT string. That is simple and unambiguous. > > but it's a disaster for people like me trying to actually take > advantage of the manifest typing feature. I have an

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread John Stanton
Actually I was talking about an application language which lets users incorporate their own SQL and which binds to the SQL at run time rather than being like embedded SQL. It doesn't need to parse SQL, it just uses the existing SQL API which provides all the necessary capability. The

Re: [sqlite] Extra functions - New Project?

2006-10-23 Thread Joe Wilson
This is not directly related to this extra functions case, but I think that a few authors of such "drive by patches" would invest more time into refining their patches if they had some feedback as to whether they might be considered for inclusion in the main tree. Even if you marked the patch

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Andy Ross
John Stanton wrote: > The method I wrote about earlier is part of a language binding. > I can show you the code if you are interested. I think we must be talking about different things, then. A language binding that allows the user to write their own SQL cannot automatically insert cast() calls

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread John Stanton
The method I wrote about earlier is part of a language binding. I can show you the code if you are interested. Andy Ross wrote: Dennis Cote wrote: > The following log shows that sqlite does indeed distinguish > between a text field and a blob with the same content. It also > shows you a

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread John Stanton
Sqlite has declared types and actual types. Both can be accessed through the API. What I do is look at the declared type, which defines the data and then look at the actual type to determine how to process it. Youn can declare the type to be anything you want. A name such a GEORGE or

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Andy Ross
Dennis Cote wrote: > The following log shows that sqlite does indeed distinguish > between a text field and a blob with the same content. It also > shows you a workaround. You simply need to cast your fields to > blobs before you compare them to a variable that is bound to a > blob. But I can't

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Andy Ross
D. Richard Hipp wrote: > There is good reason for this, actually. But I'm not sorting, nor doing a < or > comparsion. In fact none of this has to do with comparison at all, but *identity*, which is a much simpler test. Are you really arguing that there are situations where a string value (in

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Dennis Cote
Andy Ross wrote: Andy Ross wrote: Problem is, the *blob* value of "testval" does not, apparently, equal the *text* value of "testval" in the database. Just to head off the inevitable reply: no, this isn't an encoding issue. The result of "pragma encoding" on the database file is UTF-8, and

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread drh
Andy Ross <[EMAIL PROTECTED]> wrote: > > Problem is, the *blob* value of "testval" does not, apparently, equal > the *text* value of "testval" in the database. > There is good reason for this, actually. TEXT values can sort in many different orders, depending on what collating sequence is

Re: [sqlite] Re: bind with select?

2006-10-23 Thread Dennis Cote
Dave Dyer wrote: You don't appear to be using BIND in the manner I was hoping for. You're using BIND to replace variables in the query. I want to use BIND (or something like it) eliminate the need for callback functions to consume the results of a select. -- At 05:42 PM 10/20/2006, Jay

Re: [sqlite] blob vs. string in bound parameters

2006-10-23 Thread Andy Ross
Andy Ross wrote: Problem is, the *blob* value of "testval" does not, apparently, equal the *text* value of "testval" in the database. Just to head off the inevitable reply: no, this isn't an encoding issue. The result of "pragma encoding" on the database file is UTF-8, and obviously the

[sqlite] blob vs. string in bound parameters

2006-10-23 Thread Andy Ross
I'm working with the sqlite3 bindings to my "nasal" languages (http://plausible.org/nasal, if anyone is curious) and I'm having a problem with type conversion. Take a look at the attached sample code. What it basically does is to try to extract a row from a table with a bound parameter:

Re: [sqlite] Re: bind with select?

2006-10-23 Thread John Stanton
Use sqlite3_step. Dave Dyer wrote: You don't appear to be using BIND in the manner I was hoping for. You're using BIND to replace variables in the query. I want to use BIND (or something like it) eliminate the need for callback functions to consume the results of a select. -- At 05:42 PM

[sqlite] Re: bind with select?

2006-10-23 Thread Igor Tandetnik
Dave Dyer <[EMAIL PROTECTED]> wrote: You don't appear to be using BIND in the manner I was hoping for. You're using BIND to replace variables in the query. I want to use BIND (or something like it) eliminate the need for callback functions to consume the results of a select. Use

[sqlite] Re: bind with select?

2006-10-23 Thread Dave Dyer
You don't appear to be using BIND in the manner I was hoping for. You're using BIND to replace variables in the query. I want to use BIND (or something like it) eliminate the need for callback functions to consume the results of a select. -- At 05:42 PM 10/20/2006, Jay Sprenkle wrote: >On

Re: [sqlite] any data access and retrieval engine?

2006-10-23 Thread John Stanton
Sarah, email me off forum at [EMAIL PROTECTED] BTW, all my programs are ANSI standard plain vanilla C. Regards, John S Sarah wrote: > Hi, John Stanton > > I really really appreciate your warm help. > That's great if you can send me the codes of B tree and B+ tree. > Many thanks in advance. >

Re: [sqlite] SQLite Performance Issues

2006-10-23 Thread John Stanton
I built and use an application server which embeds Sqlite and processes web traffic. It is multi-threaded and can handle very many connections. It is very fast because it uses no IPC channels or process creation. It caches threads and reuses them rather than creating and killing them. It

Re: [sqlite] IF EXISTS when using DROP TABLE

2006-10-23 Thread Alexandre Guion
You can use the PRAGMA query to test if a table exists or not. "PRAGMA table_info(`tablename`)" -- Alex Guion Software Engineer OrbNetworks, Inc. www.orb.com [EMAIL PROTECTED] wrote: Thank you. My version does not. I had used one of the archives to search for this issue, but the thread I

Re: [sqlite] IF EXISTS when using DROP TABLE

2006-10-23 Thread epankoke
Thank you. My version does not. I had used one of the archives to search for this issue, but the thread I found did not have an answer to the question. -- Eric Pankoke Founder / Lead Developer Point Of Light Software http://www.polsoftware.com/ -- Original message

Re: [sqlite] IF EXISTS when using DROP TABLE

2006-10-23 Thread Adriano Ferreira
On 10/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: If I use the syntax "DROP TABLE tablename" everything is good, except of course I get a "no such table" error if the table does not exist. However, if I use the syntax "DROP TABLE IF EXISTS tablename", then I get the following error:

[sqlite] IF EXISTS when using DROP TABLE

2006-10-23 Thread epankoke
If I use the syntax "DROP TABLE tablename" everything is good, except of course I get a "no such table" error if the table does not exist. However, if I use the syntax "DROP TABLE IF EXISTS tablename", then I get the following error: 'near "EXISTS": syntax error'. Anyone have a thought as to

Re: [sqlite] Trouble with ALTER TABLE/ADD

2006-10-23 Thread Isaac Raway
Thank, I will look at that (away from my dev machine for the day). One other related question, are there plans to expand the functionality of ALTER TABLE? I am working on a feature that could benefit greatly from REMOVE/RENAME COLUMN. As it stands, I am going to have to simulate this by using

Re: [sqlite] Extra functions - New Project?

2006-10-23 Thread Mikey C
I entirely agree. I had the functions coded because I needed them for my own project. I never intended to do the other 85% of the work required to make them a supported part of SQLite. drh wrote: > > Mikey C <[EMAIL PROTECTED]> wrote: >> >> I sent the source code to DRH with the extra

Re: [sqlite] Trouble with ALTER TABLE/ADD

2006-10-23 Thread drh
"Isaac Raway" <[EMAIL PROTECTED]> wrote: > > ALTER TABLE topic ADD COLUMN type_id integer; > > This works fine when I run it on the sqlite3 command line, but fails in the > Delphi units. Any thoughts? Has anyone ahd trouble running ALTER TABLE from > the Delphi bindings? > Perhaps the delphi

[sqlite] Trouble with ALTER TABLE/ADD

2006-10-23 Thread Isaac Raway
Hi, this is my first question on this list. First, a brief introduction: I've been using sqlite for about the past year or so and so far I'm very happy with it. As far as databases, I have experience with MySQL, SQL Server and of course Access. My language skills include Delphi, PHP, Tcl, and VB

Re: [sqlite] SQLite Performance Issues

2006-10-23 Thread Christian Smith
James Mills uttered: Hi Richard, When I mean high-traffic I would imagine more than 1 hit/s. I do want to clear something up though (if you could): If a site using sqlite takes 700ms to load and there are two simultaneous (as simultaneous as one can get) hits to the site, say user A and user

Re: [sqlite] insertion time

2006-10-23 Thread Dennis Cote
Lloyd wrote: Hi, How much time it may take to "insert or ignore into query" for 30 lakhs times. It adds more than 130 sec overhead compared to the 20 sec of execution time. All these are done inside a single transaction. And these insertions are made on three tables (on each table 10 lakhs)

Re: [sqlite] SQLite Performance Issues

2006-10-23 Thread James Mills
Hrmm also a couple of other things... In order to make a decision, I would need some way of running tests and simulations so I can come up with some numbers. Then scale that up and use it as an indicator for our decision. Do you have any tools that'll help with this ? cheers James -- --

Re: [sqlite] SQLite Performance Issues

2006-10-23 Thread James Mills
Hi Richard, I appreciate your feedback on the matter. I myself have used SQLite in many of my applications in the past for quite some years now. Most of them do indeed only write to or read from teh database for only fractions of a second. When I mean high-traffic I would imagine more than 1

[sqlite] insertion time

2006-10-23 Thread Lloyd
Hi, How much time it may take to "insert or ignore into query" for 30 lakhs times. It adds more than 130 sec overhead compared to the 20 sec of execution time. All these are done inside a single transaction. And these insertions are made on three tables (on each table 10 lakhs) with a combined

Re: [sqlite] SQLite Performance Issues

2006-10-23 Thread drh
James Mills <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I'm wanting to use SQLite in an embedded web application > that will serve as a proxy and possible serve up many > connections at once. I'm talking here of high-traffic > through this web app. > > Question is, how will SQLite perform under

Re: [sqlite] Extra functions - New Project?

2006-10-23 Thread drh
Mikey C <[EMAIL PROTECTED]> wrote: > > I sent the source code to DRH with the extra functions. I don't myself have > the time now to incorporate the extra functions into SQLite. > Writing code a chunk of code is only a small fraction of the work needed to support the code in a maintained

Re: Re: [sqlite] database corrouption during power failure

2006-10-23 Thread jayanth KP
Hi Dennis Cote, But how do we read the current synchronous value using C interface. Plz reply. Regards Jayanth On Mon, 16 Oct 2006 Dennis Cote wrote : >jayanth KP wrote: >>Thanks for ur reply. I searched in the whole source code i could not find >> SQLITE_NO_SYNC flag. >>Also i

Re: [sqlite] any data access and retrieval engine?

2006-10-23 Thread Sarah
Hi, John Stanton I really really appreciate your warm help. That's great if you can send me the codes of B tree and B+ tree. Many thanks in advance. My requirements for data access are as follows: -all the data are stored in non-volatile memory instead of volatile memory -the footprint of the