Re: [sqlite] insert if record not exists without primary key

2012-01-09 Thread Simon Slavin

On 10 Jan 2012, at 7:23am, Durga D wrote:

>   create table if not exists emp(id integer primary key autoincrement,
> col1 text, col2 text, unique (col1, col2));
> 
> here, col1 and col2 should be unique. I tried to insert 1000 records
> with unique(col1, col2). It's very slow. So, I choosed id as primary key
> (surrogate key) and without unique key.
> 
> create table if not exists emp(id integer primary key autoincrement, col1
> text, col2 text);
> 
> I want to insert a record if not exists. How?

You did it correctly the first time.  That is the correct way to prevent 
duplicates.

Your test is unrealistic and will not reflect how fast the database will be in 
real life (are you really going to have your application insert 10,000,000 rows 
often ?) but if you really do want to do this, put all your insert commands 
into a transaction:

BEGIN TRANSACTION;
insert ...;
insert ...;
insert ...;
...;
END TRANSACTION;

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] insert if record not exists without primary key

2012-01-09 Thread Durga D
Hi all,

I have emp sqlite table:

   create table if not exists emp(id integer primary key autoincrement,
col1 text, col2 text, unique (col1, col2));

here, col1 and col2 should be unique. I tried to insert 1000 records
with unique(col1, col2). It's very slow. So, I choosed id as primary key
(surrogate key) and without unique key.

create table if not exists emp(id integer primary key autoincrement, col1
text, col2 text);

I want to insert a record if not exists. How?

I tried with insert or replace. Duplicates are occuring. While inserting, I
dont have primary key in my hand.

Note: id is foreign key in other 4 tables.

Thanks in advance,
Durga.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Optimal number of "inserts" in a transaction.

2012-01-09 Thread Richard Hipp
On Mon, Jan 9, 2012 at 2:28 PM, Tal Tabakman  wrote:

> Hi guys,
> I have an application that perform a lot of insert operations to a table
> (each raw contains one ~20 character string and 10 integers)
> I have read a bit about insert performance and use transactions for my
> insert operations
>

If you do:

PRAGMA journal_mode=WAL;
PRAGMA synchronous=NORMAL;

Then the performance will probably be about the same regardless of your
transaction size, and will be probably be faster than anything you can
obtain with the default DELETE journal_mode.  Try this and see if it works
fast enough for you.

Note that with PRAGMA synchronous=NORMAL and journal_mode=WAL if you
suddenly loss power, then one or more recently committed transactions might
get rolled back.  In other words, you lose Durability, the "D" in "ACID".
The database won't go corrupt (unless there are other unrelated problems
with your OS and/or hardware) but you might lose the last few seconds of
work.  Most people don't care about this, but you'll need to make that
determination for yourself based on your requirements.



> my question is: is there a rule of thumb regarding the optimal number of
> inserts in a transaction ?
> i.e. suppose that all in all I have 100 inserts operations, what will
> be faster, to bundle 20 transactions of 5 inserts or 10 transactions of
> 10 inserts ?
> cheers
> Tal
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Optimal number of "inserts" in a transaction.

2012-01-09 Thread Simon Slavin

On 9 Jan 2012, at 7:28pm, Tal Tabakman wrote:

> I have an application that perform a lot of insert operations to a table
> (each raw contains one ~20 character string and 10 integers)
> I have read a bit about insert performance and use transactions for my
> insert operations
> my question is: is there a rule of thumb regarding the optimal number of
> inserts in a transaction ?

Transactions aren't tricks for speed.  They're a part of data-handling.  A 
transaction is a bunch of operations on a database which go together: if one is 
to be done, then they're all done, if one fails, then you wouldn't want the 
others to be executed because they'd be invalid.

> i.e. suppose that all in all I have 100 inserts operations, what will
> be faster, to bundle 20 transactions of 5 inserts or 10 transactions of
> 10 inserts ?

Can't tell until you try it, with the amount of data in your rows, on your 
hardware running under your operating system.  But generally it's not important 
that your application be as fast as possible, only that it be fast enough.  So 
try your application with all those inserts in one big transaction.  Is it 
acceptably fast ?  If so, don't worry about it.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Import File with Mixed Delimiters

2012-01-09 Thread Kit
2012/1/9 rpallotta :
>
> I need to import a file to a table but there are two delimiters used in the
> file; quotes and spaces. The first 2 columns are for metadata and use
> quotes, the remaining columns are financial data (a column for each month)
> separated by spaces. For example:
>
> "Net Sales" "New York" 1000.00 999.00 1112.00
> "Expenses" "New York" 555.00 600.00 500.00



[0] => Net Sales
[1] => New York
[2] => 1000.00
[3] => 999.00
[4] => 1112.00
-- 
Kit
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Optimal number of "inserts" in a transaction.

2012-01-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/01/12 11:28, Tal Tabakman wrote:
> my question is: is there a rule of thumb regarding the optimal number
> of inserts in a transaction ?

How many can you afford to lose should there be an unexpected power
failure before performing a commit?

Other than that you will be building up a journal/wal file of
approximately the same size as the size of the data inserted.  You are
better off picking how large you are happy for that to grow to.  Remember
that you also need to include index sizes if you use them.  In your
circumstances I'd probably pick 128KB or 1MB of outstanding data unless
inserting gigabytes, in which case I would disable all journalling so
transactions wouldn't really matter.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk8LWokACgkQmOOfHg372QR7JwCgq+vF32zL3BlpJGOL+iSnLn7G
L7EAn0ceBvrxJg819uwLZUKvHhlKfNsd
=FHfq
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Android SQLiteDatabase speed comparison vs. NDK and sqlite.c?

2012-01-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/01/12 08:01, Robert Hawkey wrote:
> Is there a large difference in speed between the two?

Why would you expect there to be?  As per Amdahl's law you need to work
out how much of your program execution is spent in SQLite in the first
place.  For example if it is 5% then even if you optimised the SQLite code
to be infinitely fast, your program would still take 95% of what it did
before.

Some time is going to be spent in fsync() calls depending on how much
writing you do.  The latency for those calls is very volatile on Android
and would overwhelm any other measurements.

You are doing pretty much the same thing in both cases: starting with Java
code and values, and calling across into C.  It is essentially the same C
code running, and the values have to cross the Java C boundary somehow.

As always benchmarks are not meaningful, unless done on data and usage
patterns that substantially represent your circumstances.

Turning this around, lets say I did measure and said that using the NDK
was twice as fast for me.  How would that actually be useful to you?

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk8LWX0ACgkQmOOfHg372QTJ+ACg5dGhW/jP9RbAmeXiSkppBs7v
i+0AoNnVuuvBOybBnIDDK2iPFzRnPI1A
=wd/F
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Import File with Mixed Delimiters

2012-01-09 Thread rpallotta

I need to import a file to a table but there are two delimiters used in the
file; quotes and spaces. The first 2 columns are for metadata and use
quotes, the remaining columns are financial data (a column for each month)
separated by spaces. For example: 

"Net Sales" "New York" 1000.00 999.00 1112.00 
"Expenses" "New York" 555.00 600.00 500.00

Is there a way to import this file to SQLite when the delimiters are mixed?
I'm looking for something similar to the MySQL import parameter "optionally
enclosed by" where it knows to use the appropriate delimiter when it's
encountered. 

Thanks. 
-- 
View this message in context: 
http://old.nabble.com/Import-File-with-Mixed-Delimiters-tp33107824p33107824.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Optimal number of "inserts" in a transaction.

2012-01-09 Thread Tal Tabakman
Hi guys,
I have an application that perform a lot of insert operations to a table
(each raw contains one ~20 character string and 10 integers)
I have read a bit about insert performance and use transactions for my
insert operations
my question is: is there a rule of thumb regarding the optimal number of
inserts in a transaction ?
i.e. suppose that all in all I have 100 inserts operations, what will
be faster, to bundle 20 transactions of 5 inserts or 10 transactions of
10 inserts ?
cheers
Tal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-09 Thread Richard Hipp
Thank you for sending the sample database file.

Rather than forcing me to understand your log database, and fill in
parameters with reasonable values, I wonder if you could simply email one
or more queries (with the parameters filled in) which you find to be slower
in 3.7.9 versus 3.6.7?

On Mon, Jan 9, 2012 at 11:13 AM, Richard Hipp  wrote:

> Please send private email to d...@sqlite.org.  CC to d...@sqlite.org and
> j...@sqlite.org.
>
>
> On Mon, Jan 9, 2012 at 11:09 AM, John Elrick wrote:
>
>> Sorry "The combined files are 2.4 MB zipped"
>>
>> On Mon, Jan 9, 2012 at 11:09 AM, John Elrick 
>> wrote:
>> > Richard,
>> >
>> > I have the information available for you.  Unfortunately, it appears
>> > that I cannot actually reduce the case, however, the issues appear to
>> > be fairly confined.
>> >
>> > The test database is 6 MB and I have a database showing the
>> > performance tracking for each of the queries which is about 140KB.
>> > The combined files are 2.4 MB.  How would you prefer I send this file
>> > to you?
>> >
>> > On Fri, Jan 6, 2012 at 4:51 PM, John Elrick 
>> wrote:
>> >> Yes.  Look for it on Monday.  I'm about to leave for the day. The
>> >> queries are automatically generated and will require some mining to
>> >> get specific examples.  I should be able to reduce the range to a
>> >> simple repeatable case but it may take a while.
>> >>
>> >> Thanks very much and have a great weekend.
>> >>
>> >> On Fri, Jan 6, 2012 at 4:42 PM, Richard Hipp  wrote:
>> >>> Can you publish for us:
>> >>>
>> >>> (1) A sample database
>> >>> (2) The specific queries that are causing your problems
>> >>>
>> >>> So that we can investigate further?
>> >>>
>> >>> On Fri, Jan 6, 2012 at 4:31 PM, John Elrick > >wrote:
>> >>>
>>  Background
>>  =
>>  We have been using Sqlite3 in a project since 2007.   Because of the
>>  release cycles involved, we normally upgrade infrequently.  We
>>  recently upgraded from 3.6.7 to 3.7.9 and encountered two serious
>>  issues. We need assistance in narrowing down the causes.
>> 
>>  We are developing using Delphi.  We are using the amalgamation and
>> are
>>  compiling it using the free Borland BCC complier.  The result is an
>>  obj file which is statically linked into our application.  We have
>>  been using this technique since we began using Sqlite.
>> 
>>  In the tests below, the strategy for changing between versions is to
>>  change which obj file is statically linked into the application.  The
>>  application was recompiled between each test.
>> 
>>  Issues Encountered
>>  ===
>> 
>>  1.  After changing there is an order of magnitude performance
>>  reduction.  Using GP Profile to monitor operations, here are the
>>  results for identical application uses:
>> 
>>  Operation executes _sqlite3_step 49,152 times
>> 
>>  3.6.7 time 5.24 seconds
>>  3.7.9 time 41.19 seconds
>> 
>>  2.  During testing we encountered a bug which had not been
>> encountered
>>  before.  Research by our CTO established that in 3.7.9 a row was
>>  returned from this query which contained empty values.  In 3.6.7
>> there
>>  were no results from the query.
>> 
>>  Summation
>>  =
>>  Given how throughly Sqlite is tested I have difficulty believing
>> there
>>  is an actual bug in Sqlite.  I believe an interaction is occurring
>>  which is a result of changes to the Sqlite code base which are
>>  producing unexpected resulted when compiled into our application.  To
>>  help resolve the problem, I would like to know if there is an
>>  historical record of the amalgamations.  If so, I can carry out
>>  testing to determine in what version the problem manifests.
>> 
>>  If anyone has any other recommendations I would be pleased to hear
>>  them.  For the moment we are reverting to 3.6.7 as a temporary
>>  solution.
>> 
>>  --
>>  John Elrick
>>  Fenestra Technologies
>>  540-868-1377
>>  ___
>>  sqlite-users mailing list
>>  sqlite-users@sqlite.org
>>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> D. Richard Hipp
>> >>> d...@sqlite.org
>> >>> ___
>> >>> sqlite-users mailing list
>> >>> sqlite-users@sqlite.org
>> >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >>
>> >>
>> >>
>> >> --
>> >> John Elrick
>> >> Fenestra Technologies
>> >> 540-868-1377
>> >
>> >
>> >
>> > --
>> > John Elrick
>> > Fenestra Technologies
>> > 540-868-1377
>>
>>
>>
>> --
>> John Elrick
>> Fenestra Technologies
>> 540-868-1377
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard 

Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-09 Thread Richard Hipp
Please send private email to d...@sqlite.org.  CC to d...@sqlite.org and
j...@sqlite.org.

On Mon, Jan 9, 2012 at 11:09 AM, John Elrick wrote:

> Sorry "The combined files are 2.4 MB zipped"
>
> On Mon, Jan 9, 2012 at 11:09 AM, John Elrick 
> wrote:
> > Richard,
> >
> > I have the information available for you.  Unfortunately, it appears
> > that I cannot actually reduce the case, however, the issues appear to
> > be fairly confined.
> >
> > The test database is 6 MB and I have a database showing the
> > performance tracking for each of the queries which is about 140KB.
> > The combined files are 2.4 MB.  How would you prefer I send this file
> > to you?
> >
> > On Fri, Jan 6, 2012 at 4:51 PM, John Elrick 
> wrote:
> >> Yes.  Look for it on Monday.  I'm about to leave for the day. The
> >> queries are automatically generated and will require some mining to
> >> get specific examples.  I should be able to reduce the range to a
> >> simple repeatable case but it may take a while.
> >>
> >> Thanks very much and have a great weekend.
> >>
> >> On Fri, Jan 6, 2012 at 4:42 PM, Richard Hipp  wrote:
> >>> Can you publish for us:
> >>>
> >>> (1) A sample database
> >>> (2) The specific queries that are causing your problems
> >>>
> >>> So that we can investigate further?
> >>>
> >>> On Fri, Jan 6, 2012 at 4:31 PM, John Elrick  >wrote:
> >>>
>  Background
>  =
>  We have been using Sqlite3 in a project since 2007.   Because of the
>  release cycles involved, we normally upgrade infrequently.  We
>  recently upgraded from 3.6.7 to 3.7.9 and encountered two serious
>  issues. We need assistance in narrowing down the causes.
> 
>  We are developing using Delphi.  We are using the amalgamation and are
>  compiling it using the free Borland BCC complier.  The result is an
>  obj file which is statically linked into our application.  We have
>  been using this technique since we began using Sqlite.
> 
>  In the tests below, the strategy for changing between versions is to
>  change which obj file is statically linked into the application.  The
>  application was recompiled between each test.
> 
>  Issues Encountered
>  ===
> 
>  1.  After changing there is an order of magnitude performance
>  reduction.  Using GP Profile to monitor operations, here are the
>  results for identical application uses:
> 
>  Operation executes _sqlite3_step 49,152 times
> 
>  3.6.7 time 5.24 seconds
>  3.7.9 time 41.19 seconds
> 
>  2.  During testing we encountered a bug which had not been encountered
>  before.  Research by our CTO established that in 3.7.9 a row was
>  returned from this query which contained empty values.  In 3.6.7 there
>  were no results from the query.
> 
>  Summation
>  =
>  Given how throughly Sqlite is tested I have difficulty believing there
>  is an actual bug in Sqlite.  I believe an interaction is occurring
>  which is a result of changes to the Sqlite code base which are
>  producing unexpected resulted when compiled into our application.  To
>  help resolve the problem, I would like to know if there is an
>  historical record of the amalgamations.  If so, I can carry out
>  testing to determine in what version the problem manifests.
> 
>  If anyone has any other recommendations I would be pleased to hear
>  them.  For the moment we are reverting to 3.6.7 as a temporary
>  solution.
> 
>  --
>  John Elrick
>  Fenestra Technologies
>  540-868-1377
>  ___
>  sqlite-users mailing list
>  sqlite-users@sqlite.org
>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> >>>
> >>>
> >>>
> >>> --
> >>> D. Richard Hipp
> >>> d...@sqlite.org
> >>> ___
> >>> sqlite-users mailing list
> >>> sqlite-users@sqlite.org
> >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>
> >>
> >>
> >> --
> >> John Elrick
> >> Fenestra Technologies
> >> 540-868-1377
> >
> >
> >
> > --
> > John Elrick
> > Fenestra Technologies
> > 540-868-1377
>
>
>
> --
> John Elrick
> Fenestra Technologies
> 540-868-1377
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-09 Thread John Elrick
Sorry "The combined files are 2.4 MB zipped"

On Mon, Jan 9, 2012 at 11:09 AM, John Elrick  wrote:
> Richard,
>
> I have the information available for you.  Unfortunately, it appears
> that I cannot actually reduce the case, however, the issues appear to
> be fairly confined.
>
> The test database is 6 MB and I have a database showing the
> performance tracking for each of the queries which is about 140KB.
> The combined files are 2.4 MB.  How would you prefer I send this file
> to you?
>
> On Fri, Jan 6, 2012 at 4:51 PM, John Elrick  wrote:
>> Yes.  Look for it on Monday.  I'm about to leave for the day. The
>> queries are automatically generated and will require some mining to
>> get specific examples.  I should be able to reduce the range to a
>> simple repeatable case but it may take a while.
>>
>> Thanks very much and have a great weekend.
>>
>> On Fri, Jan 6, 2012 at 4:42 PM, Richard Hipp  wrote:
>>> Can you publish for us:
>>>
>>> (1) A sample database
>>> (2) The specific queries that are causing your problems
>>>
>>> So that we can investigate further?
>>>
>>> On Fri, Jan 6, 2012 at 4:31 PM, John Elrick wrote:
>>>
 Background
 =
 We have been using Sqlite3 in a project since 2007.   Because of the
 release cycles involved, we normally upgrade infrequently.  We
 recently upgraded from 3.6.7 to 3.7.9 and encountered two serious
 issues. We need assistance in narrowing down the causes.

 We are developing using Delphi.  We are using the amalgamation and are
 compiling it using the free Borland BCC complier.  The result is an
 obj file which is statically linked into our application.  We have
 been using this technique since we began using Sqlite.

 In the tests below, the strategy for changing between versions is to
 change which obj file is statically linked into the application.  The
 application was recompiled between each test.

 Issues Encountered
 ===

 1.  After changing there is an order of magnitude performance
 reduction.  Using GP Profile to monitor operations, here are the
 results for identical application uses:

 Operation executes _sqlite3_step 49,152 times

 3.6.7 time 5.24 seconds
 3.7.9 time 41.19 seconds

 2.  During testing we encountered a bug which had not been encountered
 before.  Research by our CTO established that in 3.7.9 a row was
 returned from this query which contained empty values.  In 3.6.7 there
 were no results from the query.

 Summation
 =
 Given how throughly Sqlite is tested I have difficulty believing there
 is an actual bug in Sqlite.  I believe an interaction is occurring
 which is a result of changes to the Sqlite code base which are
 producing unexpected resulted when compiled into our application.  To
 help resolve the problem, I would like to know if there is an
 historical record of the amalgamations.  If so, I can carry out
 testing to determine in what version the problem manifests.

 If anyone has any other recommendations I would be pleased to hear
 them.  For the moment we are reverting to 3.6.7 as a temporary
 solution.

 --
 John Elrick
 Fenestra Technologies
 540-868-1377
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

>>>
>>>
>>>
>>> --
>>> D. Richard Hipp
>>> d...@sqlite.org
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>>
>> --
>> John Elrick
>> Fenestra Technologies
>> 540-868-1377
>
>
>
> --
> John Elrick
> Fenestra Technologies
> 540-868-1377



-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-09 Thread John Elrick
Richard,

I have the information available for you.  Unfortunately, it appears
that I cannot actually reduce the case, however, the issues appear to
be fairly confined.

The test database is 6 MB and I have a database showing the
performance tracking for each of the queries which is about 140KB.
The combined files are 2.4 MB.  How would you prefer I send this file
to you?

On Fri, Jan 6, 2012 at 4:51 PM, John Elrick  wrote:
> Yes.  Look for it on Monday.  I'm about to leave for the day. The
> queries are automatically generated and will require some mining to
> get specific examples.  I should be able to reduce the range to a
> simple repeatable case but it may take a while.
>
> Thanks very much and have a great weekend.
>
> On Fri, Jan 6, 2012 at 4:42 PM, Richard Hipp  wrote:
>> Can you publish for us:
>>
>> (1) A sample database
>> (2) The specific queries that are causing your problems
>>
>> So that we can investigate further?
>>
>> On Fri, Jan 6, 2012 at 4:31 PM, John Elrick wrote:
>>
>>> Background
>>> =
>>> We have been using Sqlite3 in a project since 2007.   Because of the
>>> release cycles involved, we normally upgrade infrequently.  We
>>> recently upgraded from 3.6.7 to 3.7.9 and encountered two serious
>>> issues. We need assistance in narrowing down the causes.
>>>
>>> We are developing using Delphi.  We are using the amalgamation and are
>>> compiling it using the free Borland BCC complier.  The result is an
>>> obj file which is statically linked into our application.  We have
>>> been using this technique since we began using Sqlite.
>>>
>>> In the tests below, the strategy for changing between versions is to
>>> change which obj file is statically linked into the application.  The
>>> application was recompiled between each test.
>>>
>>> Issues Encountered
>>> ===
>>>
>>> 1.  After changing there is an order of magnitude performance
>>> reduction.  Using GP Profile to monitor operations, here are the
>>> results for identical application uses:
>>>
>>> Operation executes _sqlite3_step 49,152 times
>>>
>>> 3.6.7 time 5.24 seconds
>>> 3.7.9 time 41.19 seconds
>>>
>>> 2.  During testing we encountered a bug which had not been encountered
>>> before.  Research by our CTO established that in 3.7.9 a row was
>>> returned from this query which contained empty values.  In 3.6.7 there
>>> were no results from the query.
>>>
>>> Summation
>>> =
>>> Given how throughly Sqlite is tested I have difficulty believing there
>>> is an actual bug in Sqlite.  I believe an interaction is occurring
>>> which is a result of changes to the Sqlite code base which are
>>> producing unexpected resulted when compiled into our application.  To
>>> help resolve the problem, I would like to know if there is an
>>> historical record of the amalgamations.  If so, I can carry out
>>> testing to determine in what version the problem manifests.
>>>
>>> If anyone has any other recommendations I would be pleased to hear
>>> them.  For the moment we are reverting to 3.6.7 as a temporary
>>> solution.
>>>
>>> --
>>> John Elrick
>>> Fenestra Technologies
>>> 540-868-1377
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>
>>
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> --
> John Elrick
> Fenestra Technologies
> 540-868-1377



-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Android SQLiteDatabase speed comparison vs. NDK and sqlite.c?

2012-01-09 Thread Robert Hawkey
Hello,

I am wondering whether anyone is willing to share any speed tests they have
done comparing the Java SQLiteDatabase class vs. an NDK C or C++
implementation using the sqlite.c amalgamation file?

Is there a large difference in speed between the two?

Thanks in advance!


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users