[sqlite] Questions about SQLITE_CONFIG_SCRATCH and SQLITE_CONFIG_PAGECACHE

2015-01-29 Thread Dominique Pellé
Hi 1) Question about SQLITE_CONFIG_SCRATCH In SQLite documentation about SQLITE_CONFIG_SCRATCH, I read: === BEGIN QUOTE https://sqlite.org/c3ref/c_config_getmalloc.html === SQLite will never require a scratch buffer that is more than 6 times the database page size. If SQLite needs needs

Re: [sqlite] Logging and timing queries

2014-07-31 Thread Dominique Pellé
Ketil Froyn ke...@froyn.name wrote: Hi, In debugging and inspecting applications using sqlite, I find it would be very useful to log some or all queries sent to the database, ideally also with timing information on how long it took to gather and send the response, so that it can be

Re: [sqlite] Problem with many connections

2014-07-02 Thread Dominique Pellé
Eduardo Morras emorr...@yahoo.es wrote: On Wed, 02 Jul 2014 12:02:27 +0100 Grzegorz Sikorski g.sikor...@kelvatek.com wrote: Hi, I am not sure if my previous email had reached the list, so I just repeat it: I am developing sharding database using SQLite3 for embedded application. My code

Re: [sqlite] Problem with many connections

2014-07-02 Thread Dominique Pellé
Grzegorz Sikorski g.sikor...@kelvatek.com wrote: Hi Hick, You were right I was not finalizing statements and this prevented close to complete. When I modified my code to finalize all statements before close it works fine. This implies that you have not checked your application with valgrind

Re: [sqlite] Building multiple indexes in one scan over a table

2014-06-10 Thread Dominique Pellé
Fabian Giesen wrote: Simon Slavin wrote: ... Also, store your time as a numeric value (Unix epoch or Julian day) rather than a string. Numbers are faster to handle than strings. INTEGERs are faster to handle than REALs. :-) The time fields are 64-bit ints. The exact meaning depends on

Re: [sqlite] Documentation typo

2014-04-25 Thread Dominique Pellé
Drago, William wrote: In section 2 of http://sqlite.org/foreignkeys.html the word separately appears twice in the following sentence: Foreign key constraints are disabled by default (for backwards compatibility), so must be enabled separately for each database connection separately. Other

[sqlite] SQLITE_ENABLE_SQLLOG and sqlite3_init_sqllog

2014-01-10 Thread Dominique Pellé
Hi I wanted to use the SQLite error logging documented here... http://www.sqlite.org/errlog.html But I found that the implementation in SQLite is odd: when defining SQLITE_ENABLE_SQLLOG, SQLite calls a function sqlite3_init_sqllog() inside sqlite3_initialize(). That function

Re: [sqlite] SQlite Memory Leakage with 65536 Page Size

2013-10-28 Thread Dominique Pellé
Raheel Gupta raheel...@gmail.com wrote: Sir, is there any way to not allow malloc to hold memory ? I mean shouldnt free(), be freeing the memory ? free() frees memory in the heap, making it available to other malloc again. But it does not necessarily shrink the amount of memory used by the

Re: [sqlite] SQlite Memory Leakage with 65536 Page Size

2013-10-27 Thread Dominique Pellé
Raheel Gupta wrote: Hi, Yes, I tried Valgrind and it shows no leaks. But why would this happen with 64K pages ? In 1024 Sqlite is able to release all the memory. It might also be that your memory allocator is holding onto freed memory rather than releasing it back to the OS. How should

Re: [sqlite] Segmentation Fault With Trigger

2013-10-15 Thread Dominique Pellé
techi eth wrote: You should compile your code sqlite3.c with -g -O0 when sending a stack trace. Most likely, the bug is in your program. Since you're on Linux, try running with valgrind memcheck tool to find bugs (access to free memory, uninitialized memory, etc.) If you compile with clang-3.3

[sqlite] Missing optimization with id BETWEEN xxx AND xxx?

2013-05-15 Thread Dominique Pellé
Hi The SQL script at http://dominique.pelle.free.fr/query-between.sql shows 2 SELECT queries: * Select query #1 takes 20.2 sec (slow!) * Select query #2 takes 0.004 sec (fast!) Yet the 2 queries are equivalent. Here is how to download and run the script:

Re: [sqlite] How to achieve fastest possible write performance for a strange and limited case

2013-03-29 Thread Dominique Pellé
Pavel Ivanov paiva...@gmail.com wrote: On Fri, Mar 29, 2013 at 12:17 PM, Jeff Archer jsarc...@nanotronicsimaging.com wrote: I have previously made an apparently bad assumption about this so now I would like to go back to the beginning of the problem and ask the most basic question first

Re: [sqlite] random, infrequent disk I/O errors

2013-02-10 Thread Dominique Pellé
Greg Janée wrote: Hello, I'm running a web service that uses SQLite that throws a disk I/O exception every once in a while, meaning once every few weeks. ...snip... Any ideas? Unfortunately, the (standard) Python SQLite wrapper I'm using doesn't provide access to any more information (if

Re: [sqlite] populating a table as quickly as possible

2013-02-04 Thread Dominique Pellé
Paul Sanderson wrote: I want to populate a large table (millions of rows) as quickly as possible, The data set will not be operated on until the table is fully populated and if the operation fails I will be starting again. the operation is a one off and the table will not be added to at a

Re: [sqlite] populating a table as quickly as possible

2013-02-03 Thread Dominique Pellé
Simon Slavin slav...@bigfraud.org wrote: On 3 Feb 2013, at 6:34pm, Paul Sanderson sandersonforens...@gmail.com wrote: I want to populate a large table (millions of rows) as quickly as possible, The data set will not be operated on until the table is fully populated and if the operation

[sqlite] FTS SQLite optimize command creates very large BLOBs in *_segment table.

2013-01-31 Thread Dominique Pellé
Hi I have a database using SQLite-3.7.14 with a FTS4 virtual table (Free Text Search). The FTS table contains several millions of small documents. The FTS DB is created on a server (where creating time does not matter) and then used on an embedded device as a read-only database for FTS queries

Re: [sqlite] integrity_check out of memory

2013-01-22 Thread Dominique Pellé
Max Vlasov wrote: Hi, I found with the web search that this error (out of memory for PRAGMA integrity_check) appeared in the wild and there were some fixes related to it. Today I decided to do the check for a base that lives with its own encrypted vfs and with an sqlite version older

Re: [sqlite] How do you load a .csv and skip the first line?

2012-09-02 Thread Dominique Pellé
joe.fis...@tanguaylab.com joe.fis...@tanguaylab.com wrote: Is there some way to load a .csv file into a SQLite database table when the first row (record) of the file contains headers? This does not work? -- .separator , .import test.csv ld_assay

[sqlite] VACUUM fails once in a while with status=14 (unable to open database file)

2012-08-21 Thread Dominique Pellé
Hi Once in a while, I see an error when doing a VACUUM operation. sqlite3_exec3(...) returns status=14 (unable to open database file). I suppose that it fails to open a temporary database when doing the VACUUM operation, but I don't see why. sqlite3_extended_errcode(db) also returns

Re: [sqlite] VACUUM fails once in a while with status=14 (unable to open database file)

2012-08-21 Thread Dominique Pellé
Richard Hipp d...@sqlite.org wrote: On Tue, Aug 21, 2012 at 5:30 AM, Dominique Pellé dominique.pe...@gmail.comwrote: Hi Once in a while, I see an error when doing a VACUUM operation. sqlite3_exec3(...) returns status=14 (unable to open database file). I suppose that it fails to open

Re: [sqlite] How to know what terms were created using FTS

2012-08-17 Thread Dominique Pellé
Mohit Sindhwani m...@onghu.com wrote: Hi Ralf, On 17/8/2012 3:50 PM, Ralf Junker wrote: On 17.08.2012 09:30, Mohit Sindhwani wrote: We're using FTS4 and it works well for many things. One of the things that we'd like to do is to see what terms are being created by the tokenizer in

Re: [sqlite] VERY weird rounding error

2012-06-16 Thread Dominique Pellé
Etienne ejlist-sql...@yahoo.fr wrote: Hi Simon, Once again, I really do not care of the accuracy. I KNOW 0.1 CAN NOT BE STORED EXACTLY IN A REAL VARIABLE. I just try to figure out why the SAME CODE (sqlite3 library) with the SAME INPUT gives DIFFERENT RESULTS (no matter how

Re: [sqlite] (shell dependent) library rounding error

2012-06-15 Thread Dominique Pellé
Etienne ejlist-sql...@yahoo.fr wrote: R:\sqlite NUL select 0.1; 0.1 JSDB (www.jsdb.org) output: jsvar db = new SQLite(); jsdb.exec(select 0.1, function(r){writeln(r)}); 0.1=0.11 true You are not doing the same thing both times.  One time you are writing the

Re: [sqlite] NaN in, 0.0 out?

2012-03-27 Thread Dominique Pellé
Francis J. Monari, Esquire monarifj@juno.com wrote: All, How are +infinity and -infinity handled? Frank. Don't forget signed zero, signaling and quiet NaN. Here is a short c++ programs to show how +infinity, -infinity zero, -zero, quiet NaN, signaling NaN are internally represented in

Re: [sqlite] Bulk Insert

2011-08-13 Thread Dominique Pellé
Stephan Beal wrote: On Fri, Aug 12, 2011 at 1:51 PM, Sumit Gupta vikasu...@vikasumit.comwrote: I was try to to Read a Binary file in to the Sqlite Database using .NET. All NET to do bulk upload. I use that Dataset method to upload about 70,000 records in to SQL server and it take 10-15

Re: [sqlite] Best solution to import big DBF file?

2011-06-27 Thread Dominique Pellé
Gilles Ganault gilles.gana...@free.fr wrote: Hello I have a 87MB file in DBF format that I'd like to import into SQLite. What is the best tool for this, free or affordable? Thank you. Spatialite (extension of SQLite) implements VirtualDbf and VirtualShp. To create a virtual table from a

Re: [sqlite] Big difference in performance between Python and gcc

2011-06-02 Thread Dominique Pellé
Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/01/2011 12:25 PM, Dominique Pellé wrote: [Various optimisations] While those are all valid, they don't address the underlying issue which is C code taking five times longer than Python code for the same SQLite

Re: [sqlite] Big difference in performance between Python and gcc

2011-06-01 Thread Dominique Pellé
Alessandro Marzocchi wrote: Hello,    I made some preliminary tests for an application storing big chunks of data in a sqlite database. I did firsts tests with python and they gave me quite impressive results. I then tried to make the same test using C. I expected to get execution times to

Re: [sqlite] usleep bug?

2010-09-27 Thread Dominique Pellé
Dustin Sallings wrote: On Sep 27, 2010, at 5:43, Simon Slavin wrote: I think this differs for different platforms.  For instance: http://www.manpagez.com/man/3/usleep/ makes no mention of that fault.        It kind of does indirectly.  It says it's built on nanosleep(), and links to

[sqlite] [patch] fixed memory leak in the .dump command of command line tool sqlite-3.7.0.1

2010-08-07 Thread Dominique Pellé
Hi I noticed a memory leak when using the .dump command of command line tool sqlite3. I initially saw it when using spatialite but the same bug exists in latest sqlite-3.7.0.1. A block of memory is leaked each time the .dump command is used. In the following example, I run .dump 3 times and

Re: [sqlite] How to update many rows efficiently?

2010-08-05 Thread Dominique Pellé
Igor Tandetnik wrote: Dominique Pellé dominique.pe...@gmail.com wrote: For example, given 2 tables t1 and t2, both with 2 columns as follows... Table t1:    ID   name    --      1        2    NULL    3    NULL    4        (~1 million records) Table t2:    ID   name

[sqlite] How to update many rows efficiently?

2010-08-04 Thread Dominique Pellé
Hi I'm new to SQLite and I'm still learning. It's unclear to me how to update many records efficiently in a table. For example, given 2 tables t1 and t2, both with 2 columns as follows... Table t1: ID name -- 1 2NULL 3NULL 4 (~1