[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread Deepak Hegde
Hi Ryan, Since you mentioned index, I started looking into other constrains and logic i had on DB. which made me realize about the trigger. Thanks a lot. Thanks and Regards Deepak On Wednesday 30 September 2015 04:47 PM, R.Smith wrote: > > > On 2015-09-30 12:31 PM, Deepak Hegde wrote: >> On

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread Deepak Hegde
Hi Ryan, Thanks a lot for your support. I had a trigger to update the one of the column in audio table on insert to audio table. That made this delay. Thanks and Regards Deepak On Wednesday 30 September 2015 04:01 PM, Deepak Hegde wrote: > Hi Ryan, > > Please find my reply below. Thanks a lot.

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread Deepak Hegde
Hi Ryan, Please find my reply below. Thanks a lot. Thanks and Regards Deepak On Wednesday 30 September 2015 03:30 PM, R.Smith wrote: > > > On 2015-09-30 11:46 AM, Deepak Hegde wrote: >> Hi All, >> >> I have a to copy entry from on database to another which have the >> similar structure. >> >>

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread Deepak Hegde
Hi Ryan, Please find my reply below. Thanks a lot. Thanks and Regards Deepak On Wednesday 30 September 2015 03:30 PM, R.Smith wrote: > > > On 2015-09-30 11:46 AM, Deepak Hegde wrote: >> Hi All, >> >> I have a to copy entry from on database to another which have the >> similar structure. >> >>

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread Deepak Hegde
Hi All, I have a to copy entry from on database to another which have the similar structure. So I am using the method of ATTACH the DB and INSERT statement to insert the 200 entries at a time. I have observed that as the entries in the copied database increases event though I am inserting 200

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread R.Smith
On 2015-09-30 12:31 PM, Deepak Hegde wrote: > On Wednesday 30 September 2015 03:30 PM, R.Smith wrote: >> >> On 2015-09-30 11:46 AM, Deepak Hegde wrote: >>> Hi All, >>> >>> I have a to copy entry from on database to another which have the >>> similar structure. >>> >>> So I am using the method of

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread R.Smith
On 2015-09-30 11:46 AM, Deepak Hegde wrote: > Hi All, > > I have a to copy entry from on database to another which have the > similar structure. > > So I am using the method of ATTACH the DB and INSERT statement to insert > the 200 entries at a time. > I have observed that as the entries in the

Re: [sqlite] Insert statement

2013-09-13 Thread Keith Medcalf
13 September, 2013 20:20 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Insert statement > > On Thu, 12 Sep 2013 18:15:29 + > "Joseph L. Casale" <jcas...@activenetwerx.com> wrote: > > > > If you make val unique -- and I see no reason no

Re: [sqlite] Insert statement

2013-09-13 Thread James K. Lowden
On Thu, 12 Sep 2013 18:15:29 + "Joseph L. Casale" wrote: > > If you make val unique -- and I see no reason not to -- then you > > can select the id for every val you insert with "where val = > > I omitted the fact that val in table_a is unique. Ah, that will be

Re: [sqlite] Insert statement

2013-09-12 Thread David King
> What is the most efficient way to insert several records into a table which > has a fk ref to the auto incrementing pk of another insert I need to do in the > same statement. Without knowing too much about your application, I'd say that it's usually fine to just: 1. Do the INSERT 2. Get the

Re: [sqlite] Insert statement

2013-09-12 Thread Joseph L. Casale
> Yes, that's what I suspected. Because your table_a has no natural key, you > have > no good way to select the auto-generated id value. You can find out what the > last > auto-generated value was, which lets you work a row at a time, but you're > really > suffering from a poor design

Re: [sqlite] Insert statement

2013-09-11 Thread James K. Lowden
On Mon, 9 Sep 2013 02:17:00 + "Joseph L. Casale" wrote: > > If I understand the question, and there is no key other than the > > auto-incrementing integer, there might not be a good way. It > > sounds like the database's design may have painted you into a > >

Re: [sqlite] Insert statement

2013-09-08 Thread Kees Nuyt
On Sun, 8 Sep 2013 22:56:20 +, "Joseph L. Casale" wrote: >Hi, >What is the most efficient way to insert several records into a table which >has a fk ref to the auto incrementing pk of another insert I need to do in the >same statement. What is efficient?

Re: [sqlite] Insert statement

2013-09-08 Thread Simon Slavin
On 9 Sep 2013, at 3:36am, Joseph L. Casale wrote: > That is the procedure I utilize normally, the requirement for this specific > case is > that the entire set of inserts into table_a be bundled with their associated > inserts > into table_b in one statement where I

Re: [sqlite] Insert statement

2013-09-08 Thread David Bicking
, key, val)       SELECT id, 'yyy', 'zzz' from table_lastid; David From: Joseph L. Casale <jcas...@activenetwerx.com> To: "sqlite-users@sqlite.org" <sqlite-users@sqlite.org> Sent: Sunday, September 8, 2013 10:17 PM Subject: Re: [sq

Re: [sqlite] Insert statement

2013-09-08 Thread Keith Medcalf
qlite.org] On Behalf Of Simon Slavin > Sent: Sunday, 8 September, 2013 20:27 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Insert statement > > > On 9 Sep 2013, at 3:17am, Joseph L. Casale <jcas...@activenetwerx.com> > wrote: > > > INSERT INT

Re: [sqlite] Insert statement

2013-09-08 Thread Keith Medcalf
t: Sunday, 8 September, 2013 20:17 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Insert statement > > > If I understand the question, and there is no key other than the auto- > incrementing > > integer, there might not be a good way. It sounds like the database

Re: [sqlite] Insert statement

2013-09-08 Thread Joseph L. Casale
> Look up the last_insert_rowid() you want and store it in your programming > language. That's what programming languages are for. But if you want to do > it less efficiently ... Hey Simon, That is the procedure I utilize normally, the requirement for this specific case is that the entire set

Re: [sqlite] Insert statement

2013-09-08 Thread Simon Slavin
On 9 Sep 2013, at 3:17am, Joseph L. Casale wrote: > INSERT INTO table_a (val) VALUES ('xx'); > INSERT INTO table_b (id, key, val) > SELECT last_insert_rowid(), 'yyy', 'zzz'; > > Just not sure how to perform 20 or 30 of those inserts into table_b after the

Re: [sqlite] Insert statement

2013-09-08 Thread Joseph L. Casale
> If I understand the question, and there is no key other than the > auto-incrementing > integer, there might not be a good way. It sounds like the database's design > may > have painted you into a corner. Hi James, Well, after inserting one row into table A which looks like (without

Re: [sqlite] Insert statement

2013-09-08 Thread James K. Lowden
On Sun, 8 Sep 2013 22:56:20 + "Joseph L. Casale" wrote: > What is the most efficient way to insert several records into a table > which has a fk ref to the auto incrementing pk of another insert I > need to do in the same statement. If I understand the question,

[sqlite] Insert statement

2013-09-08 Thread Joseph L. Casale
Hi, What is the most efficient way to insert several records into a table which has a fk ref to the auto incrementing pk of another insert I need to do in the same statement. I am migrating some code away from using the SQLAlchemy orm to using the Core. The way the data is returned to me is a

Re: [sqlite] insert statement using temp variable

2011-04-05 Thread Igor Tandetnik
RAKESH HEMRAJANI wrote: > int i=0; > rc = sqlite3_exec(db, "insert into emp values(i);", 0, 0, ); Use sqlite3_prepare_v2, sqlite3_step, sqlite3_bind_* et al to run a parameterized query. Something like this: sqlite3_stmt* stmt; sqlite3_prepare_v2(db, "insert into

Re: [sqlite] insert statement using temp variable

2011-04-04 Thread venkat easwar
g Sent: Tue, April 5, 2011 10:51:09 AM Subject: [sqlite] insert statement using temp variable hi, need help with very basic question.. More of C than SQLite. have a very simple C program using sqlite DB. .. int i=0; rc = sqlite3_exec(db, "create table emp (empid num);", callb

[sqlite] insert statement using temp variable

2011-04-04 Thread RAKESH HEMRAJANI
hi, need help with very basic question.. More of C than SQLite. have a very simple C program using sqlite DB. .. int i=0; rc = sqlite3_exec(db, "create table emp (empid num);", callback, 0, ); rc = sqlite3_exec(db, "insert into emp values(i);", 0, 0, ); ---

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-11 Thread Dennis Cote
Lothar Behrens wrote: > Am 10.09.2008 um 17:37 schrieb Dennis Cote: > >> Lothar Behrens wrote: >>> What is the function to rollback a transaction or commit ? >>> I want also to break into these functions. If there is no way I try >>> to implement the rollback and commit callbacks. >>> Also the

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-11 Thread Lothar Behrens
Am 10.09.2008 um 17:37 schrieb Dennis Cote: > Lothar Behrens wrote: >> What is the function to rollback a transaction or commit ? >> I want also to break into these functions. If there is no way I try >> to implement the rollback and commit callbacks. >> Also the closing of the database would

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-10 Thread Lothar Behrens
Am 09.09.2008 um 22:49 schrieb Dennis Cote: > Lothar Behrens wrote: >> >> But when you say, that, if jornal files are open, transactions are >> opened, I would set a >> breakpoint at the line of code the transaction opens these jornal >> file >> and I could look >> arount there from who the

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Lothar Behrens wrote: > > But when you say, that, if jornal files are open, transactions are > opened, I would set a > breakpoint at the line of code the transaction opens these jornal file > and I could look > arount there from who the transaction comes. > > Is that an option ? > > What

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
Am 09.09.2008 um 20:46 schrieb Dennis Cote: > Lothar Behrens wrote: >> >> I have added this function right after sqlite3_step, that does the >> prepared insert statement. >> >> int nReturn = sqlite3_step((sqlite3_stmt*)(*start)); >> >>int autocommit =

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Lothar Behrens wrote: > > I have added this function right after sqlite3_step, that does the > prepared insert statement. > > int nReturn = sqlite3_step((sqlite3_stmt*)(*start)); > > int autocommit = sqlite3_get_autocommit(m_pDatabase); > > if (autocommit == 0) { >

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
Am 09.09.2008 um 17:20 schrieb Dennis Cote: > Jay A. Kreibich wrote: >> >> Everything you describe sounds exactly as if a transaction has been >> started, but is not committed. When you close the database, the >> transaction is automatically (and correctly) rolled back. This will >> also

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Jay A. Kreibich wrote: > > Everything you describe sounds exactly as if a transaction has been > started, but is not committed. When you close the database, the > transaction is automatically (and correctly) rolled back. This will > also delete the journal file. > > I know you said

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Jay A. Kreibich
On Tue, Sep 09, 2008 at 04:55:01PM +0200, Lothar Behrens scratched on the wall: > I prepare an insert statement and bind the parameters that afterwards > get executed with sqlite_step(). This function then returns SQLITE_DONE > and I prepare a new select statement wich let me display the just

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Lothar Behrens wrote: > > Does someone have any more ideas how to narrow the problem ? > (After the insert statement until to closing of that file) > Try executing "pragma database_list;" after the insert. Double check the file name and path shown for the main database and ensure that is the

[sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
Hi, I am still struggle with my insert statement with bound parameters that - followed step by step in the VDBE - seems to be inserted but is not available after closing the database. (Checked with sqliteman) I have also created a small test application using my database API wrappers. In

Re: [sqlite] Insert statement taking too long

2006-11-09 Thread spaminos-sqlite
- Original Message From: Unit 5 <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, November 9, 2006 8:02:51 AM Subject: RE: [sqlite] Insert statement taking too long > --- Robert Simpson <[EMAIL PROTECTED]> wrote: > > You need to create an index

RE: [sqlite] Insert statement taking too long

2006-11-09 Thread Christian Smith
Unit 5 uttered: --- Robert Simpson <[EMAIL PROTECTED]> wrote: You need to create an index on the columns you're joining. Otherwise I believe 100,000,000 rows (10k x 10k) in table 2 will be scanned while SQLite looks for matches against the 10,000 rows in table 1. While that makes sense, I

RE: [sqlite] Insert statement taking too long

2006-11-09 Thread Unit 5
--- Robert Simpson <[EMAIL PROTECTED]> wrote: > You need to create an index on the columns you're > joining. Otherwise I > believe 100,000,000 rows (10k x 10k) in table 2 will > be scanned while SQLite > looks for matches against the 10,000 rows in table > 1. While that makes sense, I suspect

RE: [sqlite] Insert statement taking too long

2006-11-08 Thread Robert Simpson
Wednesday, November 08, 2006 10:47 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] Insert statement taking too long > > Hello, > > I am seeing an interesting performance issue with > INSERT statements. I am using Sqlite 3.3.5 on a > Windows XP box. Here is a brief summar

[sqlite] Insert statement taking too long

2006-11-08 Thread Unit 5
Hello, I am seeing an interesting performance issue with INSERT statements. I am using Sqlite 3.3.5 on a Windows XP box. Here is a brief summary of the situation: Insert statements that require no join are quite fast: a) I create an empty table (drop it first if it exists). b) INSERT ... SELECT