[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-08-20 Thread Paolo Bolzoni
Scott you can still set it up using setenv(Posix) or _putenv_s_(Windows). Can't you? On Wed, Aug 19, 2015 at 10:23 AM, Scott Doctor wrote: > > Another issue to consider is security. Some programs, such as mine, needs to > carefully control temporary files. Unless the user selects a specific >

[sqlite] ATTACH DATABASE statement speed

2015-08-20 Thread Paolo Bolzoni
On Wed, Aug 19, 2015 at 6:53 PM, Simon Slavin wrote: > On 19 Aug 2015, at 10:46am, Paolo Bolzoni > wrote: > Just by itself, the above information is significant to the SQLite team. > Perhaps when you have had a chance to confirm it a new thread can be started > called '

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Paolo Bolzoni
On Wed, Aug 19, 2015 at 11:44 AM, Simon Slavin wrote: > Hmm. Would it be possible to format an external drive in ZFS and try the > operations on files stored on that ? As you might have guessed from the timezone I am not at home atm, so I do not have spare external disks. However, I do have

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Paolo Bolzoni
I see. Thanks nameless person known as sqlite-mail (npkasm for short), what you say makes sense. However it does not explain why the pragma checks are so slow. Anyhow, npkasm, I will keep in mind for the future. Good point indeed. On Wed, Aug 19, 2015 at 3:59 PM, sqlite-mail wrote: > Hello ! >

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Paolo Bolzoni
> > > Am 18.08.2015 um 12:38 schrieb Paolo Bolzoni: >> >> It really seems something strange happens at filesystem level. >> >> This is a simple copy of slightly less than 1gb. It needs 9 seconds >> including sync. >> % date && sudo rsync -Pr ita

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-08-19 Thread Paolo Bolzoni
Wouldn't be easier to simply add a parameter to sqlite3_initialize()? E.g., a char const pointer to the tmp directory? That, if null, defaults to something reasonable as James mentioned? Maybe I am oversensitive, but I found strange I have to use setenv to setup a command line option about "where

[sqlite] ATTACH DATABASE statement speed

2015-08-18 Thread Paolo Bolzoni
On Tue, Aug 18, 2015 at 7:26 PM, Simon Slavin wrote: > > On 18 Aug 2015, at 7:30am, Paolo Bolzoni > wrote: > >> Any other idea of what can I try? Perhaps my filesystem is misconfigured? > > The long time you quote is not standard for SQLite and I don't think anyone

[sqlite] ATTACH DATABASE statement speed

2015-08-18 Thread Paolo Bolzoni
: in fact the programs seems to use 5% of the CPU tops. Any other idea of what can I try? Perhaps my filesystem is misconfigured? On Tue, Aug 18, 2015 at 3:02 PM, Paolo Bolzoni wrote: > I think the ATTACH slowness was a misunderstanding caused by the > optimization as it does not happen anymore

[sqlite] ATTACH DATABASE statement speed

2015-08-18 Thread Paolo Bolzoni
events logged lines in dmesg. I try to investigate more. On Tue, Aug 18, 2015 at 12:28 PM, Simon Slavin wrote: > > On 18 Aug 2015, at 4:14am, Paolo Bolzoni > wrote: > >> In the input and output database I had a table of the same name and using: >> >> DROP TABLE IF E

[sqlite] ATTACH DATABASE statement speed

2015-08-18 Thread Paolo Bolzoni
OK for the db, but after about 13 hours. I also tried to copy the db in another disk, copy back and compare with cmp. All fine. Cheers, Paolo On Mon, Aug 17, 2015 at 9:26 PM, Simon Slavin wrote: > > On 17 Aug 2015, at 9:22am, Paolo Bolzoni > wrote: > >> The pragma integr

[sqlite] ATTACH DATABASE statement speed

2015-08-17 Thread Paolo Bolzoni
The pragma integrity_check is still running... Maybe my disk sucks for some reason? The output of iostat looks normal to me though.. $ iostat -dmN encplate 1 5 Linux 4.1.4-1-ARCH (slyrogue) 08/17/2015 _x86_64_(8 CPU) Device:tpsMB_read/sMB_wrtn/sMB_read

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-08-17 Thread Paolo Bolzoni
If the problem is the multi-threading, it would be not enough to simply document that the tmp directory should be set before spawning any thread? e.g., in the main? On Sat, Aug 15, 2015 at 9:17 AM, Simon Slavin wrote: > >> On 15 Aug 2015, at 12:53am, James K. Lowden >> wrote: >> >> Simon

[sqlite] ATTACH DATABASE statement speed

2015-08-17 Thread Paolo Bolzoni
Dear list, I have a program that materialize the subset of a database in a second database for future use. To do so I create the database object on the OUTPUT database, create tables, create the indexes, and vacuum it just in the case I reused an old file. After I attach the INPUT db and I copy

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-07-28 Thread Paolo Bolzoni
I guess it is not really a problem, but it means that a part of the deprecated pragma there is no fully portable way? On Tue, Jul 28, 2015 at 10:56 AM, Clemens Ladisch wrote: > Simon Slavin wrote: >> both platforms use whatever the expected variable name was for that OS. > > Unix: > 1. #pragma

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-07-28 Thread Paolo Bolzoni
So, just be sure we are in the same page: >From the C interface, the way to decide the directory is setting the value of sqlite3_temp_directory char pointer. As explained here: https://www.sqlite.org/c3ref/temp_directory.html This is also the first place sqlite3 checks. >From anywhere else

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-07-27 Thread Paolo Bolzoni
Dear list, I have a somewhat large sqlite3 db (about 120GB) and I need to create some indexes on it, but I get "database or disk is full" while I have still about 300GB of free disk space. However the /tmp directory is only 5GB so I suspect that sqlite3 has not enough space there. I found the

[sqlite] step and reset or reset and step?

2015-04-10 Thread Paolo Bolzoni
Dear list, The subject already says it all, I was wondering what is the best practice for a prepared statement that need to be used an unknown number of times. It is better to reset and step (as many times as needed) or step and reset after? Or there is no real difference? Yours faithfully,

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-03 Thread Paolo Bolzoni
> I can't confirm that 100% off the top of my head but I'm uncoordinated > enough to repeatedly confuse the bind and column value API calls and use > 0-based indices for both and haven't noticed any really untoward behaviour > (beyond my code not working and requiring fixing). I know the feeling,

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-02 Thread Paolo Bolzoni
problem, I was merely curious. On Mon, Mar 2, 2015 at 1:23 AM, Jay Kreibich wrote: > > On Mar 1, 2015, at 5:33 PM, Richard Hipp wrote: > >> On 3/1/15, Paolo Bolzoni wrote: >>> Dear everyone, >>> >>> I find strange and confusing that bind indexes start f

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-01 Thread Paolo Bolzoni
Dear everyone, I find strange and confusing that bind indexes start from 1 (docs in [1]) and instead column indexes start from 0 (doc in [2]). Is there any technical reason or it is just an unlucky legacy? Yours faithfully, Paolo [1] https://www.sqlite.org/c3ref/bind_blob.html [2]

[sqlite] Sqlite3 tutorial and reference manuals?

2015-02-21 Thread Paolo Bolzoni
About SQL I like the w3c schools[1]; about sqlite how do you want to use it? Via C interface? If so, check the website "sqlite in 5 minutes or less"[2]. [1]http://www.w3schools.com/sql/ [2]https://www.sqlite.org/quickstart.html On Sat, Feb 21, 2015 at 7:33 PM, russ lyttle wrote: > I'm new to

Re: [sqlite] Problem with method numRows() in Sqlite3

2013-09-23 Thread Paolo Bolzoni
As far as I know the only way to know the number of returned rows is scanning all the query result. Isn't it? On Mon, Sep 23, 2013 at 5:48 PM, John McKown wrote: > Basically, this is telling you that there is no such function as > "Sqlite3::numRows". I did a fast

Re: [sqlite] Problem with method numRows() in Sqlite3

2013-09-23 Thread Paolo Bolzoni
You are using a binding, right? Please, can you show the problem with the plain C interface? On Mon, Sep 23, 2013 at 5:50 AM, pisey phon wrote: > Dear Sqlite Team > > > I have some problem with Sqlite3. > > > Would you mind if I want to ask you a question? > > > I got an

Re: [sqlite] EncFs + sqlite3

2013-09-23 Thread Paolo Bolzoni
What do you mean with "if you do not ATTTACH databases"? I should not use the ATTACH DATABASE command to add a second database to a connection or I cannot use a db at all? On Mon, Sep 23, 2013 at 3:43 PM, Clemens Ladisch <clem...@ladisch.de> wrote: > Paolo Bolzoni wrote:

[sqlite] EncFs + sqlite3

2013-09-23 Thread Paolo Bolzoni
Dear list, I was wondering, is using sqlite3 under EncFs safe? For "safe" I mean is the db is strong against data corruption as in a usual filesystem? Do anyone has experience? It would be reasonably easy to test? Your faithfully, Paolo ___

Re: [sqlite] SQLite clusters?

2013-09-17 Thread Paolo Bolzoni
I did not know that, I will look more into it. Thanks! On Tue, Sep 17, 2013 at 10:36 PM, Petite Abeille <petite.abei...@gmail.com> wrote: > > On Sep 17, 2013, at 10:19 PM, Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> > wrote: > >> Sorry for the out topic, but

Re: [sqlite] SQLite clusters?

2013-09-17 Thread Paolo Bolzoni
> We have an app that uses SQLite, running in 4 servers, with 0mq (nanomsg > soon) to get locking exclusive on writes on all databases and pass data > sending raw sql inserts, updates and deletes. We don't have lot of nor big > writes, never use triggers that modify data or calculate secundary

Re: [sqlite] to encrypt sqlite db

2013-09-01 Thread Paolo Bolzoni
Another weird sentence in the mailing list of probably most used DB that is really free. On Sun, Sep 1, 2013 at 6:10 PM, Etienne wrote: > On Sun, Sep 1, 2013, at 17:50, Clemens Ladisch wrote: >> Ulrich Telle wrote: >> > Am 31.08.2013 22:01, schrieb Etienne: >> >> I

Re: [sqlite] Is SQLite a DBMS?

2013-09-01 Thread Paolo Bolzoni
Wait a second, this is a mailing list where you need to register to write. Isn't it? It means the OP actually registered but he did not try to seek for wikipedia sqlite in google? It is just me or it is quite weird? On Sun, Sep 1, 2013 at 12:23 PM, Simon Slavin wrote: > >

Re: [sqlite] to encrypt sqlite db

2013-08-31 Thread Paolo Bolzoni
That last sentence is quite weird, a good encryption system should give a random-like sequence even with very low-entropy input. On the other hand removing patterns definitely cannot hurt. On Sat, Aug 31, 2013 at 4:38 PM, Etienne wrote: >> Thank you for your quick

Re: [sqlite] to encrypt sqlite db

2013-08-31 Thread Paolo Bolzoni
There is a non-free version of sqlite that encrypt the db. If it is that you want then you have to contact them directly. Otherwise just use sqlite on a EncFs mounted disk? On Sat, Aug 31, 2013 at 2:25 PM, dd wrote: > Hi All, > > I have to encrypt sqlite database on

Re: [sqlite] Using VACUUM on an empty file will create a defaultdatabase

2013-07-25 Thread Paolo Bolzoni
I also have hard time follow... My answer would be: "yes," What is the problem? On Thu, Jul 25, 2013 at 8:51 AM, wrote: > I'm not sure what you want to say me. "echo 'garbage' > some/random/file" > will also overwrite non-empty files which is more problematic. > >

Re: [sqlite] Integer data type

2013-07-19 Thread Paolo Bolzoni
Or just use a BLOB. On Fri, Jul 19, 2013 at 2:29 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 19 Jul 2013, at 1:20pm, Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> > wrote: > >> True, I was thinking as follow up of what I >> mentioned in the

Re: [sqlite] Integer data type

2013-07-19 Thread Paolo Bolzoni
Interesting problem, can you add a new comparison operator to sqlite3? On Fri, Jul 19, 2013 at 2:19 PM, Hick Gunter <h...@scigames.at> wrote: > It might change the sort order... > > -Ursprüngliche Nachricht----- > Von: Paolo Bolzoni [mailto:paolo.bolzoni.br...@gmail.com] &

Re: [sqlite] Integer data type

2013-07-19 Thread Paolo Bolzoni
t 8:11 AM, Paolo Bolzoni < > paolo.bolzoni.br...@gmail.com> wrote: > >> After all do you really care if the unsigned >> int 4294967285 is stored as -11? >> > > To be pedantic: SQLite stores 4294967285 as 4294967285. It is > 18446744073709551605 that gets stored as

Re: [sqlite] Integer data type

2013-07-19 Thread Paolo Bolzoni
After all do you really care if the unsigned int 4294967285 is stored as -11? On Fri, Jul 19, 2013 at 1:13 PM, Simon Slavin wrote: > > On 19 Jul 2013, at 11:02am, techi eth wrote: > >> Definition of integer data type will talk for signed integer. What

Re: [sqlite] Integer data type

2013-07-19 Thread Paolo Bolzoni
As far as I know there is no unsigned integer in sqlite3. If you need cast to a signed integer of the same size before using sqlite3. On Fri, Jul 19, 2013 at 12:02 PM, techi eth wrote: > Definition of integer data type will talk for signed integer. What about > unsigned

Re: [sqlite] SQLite3 : Corrupt/IO Error

2013-07-19 Thread Paolo Bolzoni
an do integrity check by PRAGMA integrity_check.Please correct me if i > wrong. > Here backup means copying database file OR we can create query to SQLite > for backup or copy. > > Cheers- > Techi > > > > On Wed, Jul 17, 2013 at 4:42 PM, Paolo Bolzoni < > paolo.

Re: [sqlite] Memory usage of sqlite3

2013-07-17 Thread Paolo Bolzoni
> Some changes, if blob is bigger than a few bytes, you should normalize them. > If 2 blobs are equal, their id must be equal and you don't waste time > comparing nor memory joining blob content. So you get: They are quite small (max ~70 bytes...) > DROP TABLE IF EXISTS tour_blob; > CREATE

Re: [sqlite] SQLite3 : Corrupt/IO Error

2013-07-17 Thread Paolo Bolzoni
On Wed, Jul 17, 2013 at 12:55 PM, techi eth wrote: > 2) How do we make database safe from these error Or What is Possibility > to > access database after error. After error, as Stephan said you are out of luck. You should avoid this errors in the first place: - make

Re: [sqlite] Memory usage of sqlite3

2013-07-17 Thread Paolo Bolzoni
On Tue, Jul 16, 2013 at 8:13 PM, Eduardo wrote: > Can you show us the query and/or schemas? If not: Sure, I appended everything in the bottom of this email. Unfortunately gmail will mess-up the layout, I hope it will be readable. (See here, it seems google does not know the

Re: [sqlite] Memory usage of sqlite3

2013-07-16 Thread Paolo Bolzoni
, maybe I should not worry at all? On Tue, Jul 16, 2013 at 1:11 PM, Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> wrote: > On Tue, Jul 16, 2013 at 1:00 PM, Dan Kennedy <danielk1...@gmail.com> wrote: >> On 07/16/2013 01:49 AM, Paolo Bolzoni wrote: > >> A very large bl

Re: [sqlite] Memory usage of sqlite3

2013-07-16 Thread Paolo Bolzoni
On Tue, Jul 16, 2013 at 1:00 PM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 07/16/2013 01:49 AM, Paolo Bolzoni wrote: > A very large blob or string result? I would exclude this, I do use blobs... but they are at most few dozen of bytes... > Code allocates (or leaks) >

Re: [sqlite] Memory usage of sqlite3

2013-07-16 Thread Paolo Bolzoni
The test ended sometime during the night and setting temp_store to 0 the result is exactly the same. I suspect it was the default anyway. On Mon, Jul 15, 2013 at 9:20 PM, Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> wrote: > On Mon, Jul 15, 2013 at 9:08 PM, Eduardo Morras <emorr

Re: [sqlite] Memory usage of sqlite3

2013-07-15 Thread Paolo Bolzoni
On Mon, Jul 15, 2013 at 9:08 PM, Eduardo Morras <emorr...@yahoo.es> wrote: > On Mon, 15 Jul 2013 20:49:52 +0200 > Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> wrote: > >> From 35-40MB to 940MB; I would put massif result but I think the >> list deletes attachments

Re: [sqlite] Memory usage of sqlite3

2013-07-15 Thread Paolo Bolzoni
On Mon, Jul 15, 2013 at 8:59 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 15 Jul 2013, at 7:49pm, Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> > wrote: > >> From 35-40MB to 940MB; I would put massif result but I think the >> list deletes attachmen

Re: [sqlite] Memory usage of sqlite3

2013-07-15 Thread Paolo Bolzoni
>From 35-40MB to 940MB; I would put massif result but I think the list deletes attachments. On Mon, Jul 15, 2013 at 8:41 PM, Stephan Beal <sgb...@googlemail.com> wrote: > On Mon, Jul 15, 2013 at 8:39 PM, Paolo Bolzoni < > paolo.bolzoni.br...@gmail.com> wrote: > >> So

[sqlite] Memory usage of sqlite3

2013-07-15 Thread Paolo Bolzoni
I wrote an C++ application that uses sqlite3 to save part of the data when it become larger than a known threshold. The idea is to use at most a known quantity of memory; to check if it is working I executed a relevant test using valgrind's massif. It worked fairly well most of the time, but in

[sqlite] Calling sqlite3_column_int on a column with a too large number?

2013-07-10 Thread Paolo Bolzoni
The subject pretty much says it all. I am curious to know what sqlite3 does when asking for the result value of a column passing a type that is too small. For example in my system int are 32 bits as result of a query I got a 10 billions: what happens using sqlite3_column_int to get that result?

Re: [sqlite] What number(2) means?

2013-07-10 Thread Paolo Bolzoni
Yes, I think it is possible to put only for compatibility reasons. Maybe in some other db systems you can set the magnitude? On Wed, Jul 10, 2013 at 10:06 AM, Woody Wu <narkewo...@gmail.com> wrote: > On Wed, Jul 10, 2013 at 09:53:41AM +0200, Paolo Bolzoni wrote: >> Se

Re: [sqlite] What number(2) means?

2013-07-10 Thread Paolo Bolzoni
See here: http://www.sqlite.org/datatype3.html I think it just means Integer. And its size depends on the magnitude of the number stored. On Wed, Jul 10, 2013 at 9:44 AM, Woody Wu wrote: > I have an old dabase, some integer columns were defined as type of > number(2).

Re: [sqlite] Literature on the information theory behind SQL(lite)?

2013-07-10 Thread Paolo Bolzoni
On Wed, Jul 10, 2013 at 3:27 AM, Jay A. Kreibich wrote: > really *know* OOP. Similarly, even if you're an expert C++ developer, > if C++ is you're only OOP language, you still don't really get what > clean OOP is all about (because C++ sure as heck isn't that, even if >

Re: [sqlite] Literature on the information theory behind SQL(lite)?

2013-07-09 Thread Paolo Bolzoni
I am sorry the part that look Greek to you is actually fairly important base of the theory behind SQL, the relational algebra. A possible answer to your question is the classic book: Database Systems, The complete book of Ullman et. all. It is comprehensive, so it should satisfy all your

Re: [sqlite] GUI for SQLite

2013-06-26 Thread Paolo Bolzoni
te-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Paolo Bolzoni > Sent: Wednesday, June 26, 2013 10:26 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] GUI for SQLite > > Ar

Re: [sqlite] GUI for SQLite

2013-06-26 Thread Paolo Bolzoni
Are you sure it is free? I cannot find the code... On Wed, Jun 26, 2013 at 6:28 AM, jorje wrote: > Take a look on a free gui tool -- Valentina Studio. Amazing product! IMO > this is the best manager for SQLite for all platforms. >

Re: [sqlite] Multiprocess accessing SQLite connection

2013-06-17 Thread Paolo Bolzoni
Yes... but it should be clear that each process will have only access to the data it has written and it won't have access to the data written by other processes. On Mon, Jun 17, 2013 at 3:08 PM, Igor Tandetnik wrote: > On 6/17/2013 1:01 AM, Vijay Khurdiya wrote: >> >> In that

Re: [sqlite] Serialize an in-memory database

2013-06-06 Thread Paolo Bolzoni
If you accept the slowdown of .dump you can directly use the backup option... On Thu, Jun 6, 2013 at 2:10 PM, Philip Bennefall wrote: > > - Original Message - From: "Simon Slavin" > > To: ; "General Discussion of SQLite

Re: [sqlite] Serialize an in-memory database

2013-06-06 Thread Paolo Bolzoni
What is you use case? Why do you need this? I am asking because maybe it helps thinking alternate solutions... On Thu, Jun 6, 2013 at 10:05 AM, Philip Bennefall <phi...@blastbay.com> wrote: > > - Original Message - From: "Paolo Bolzoni" > <paolo.bolzoni.b

Re: [sqlite] Serialize an in-memory database

2013-06-06 Thread Paolo Bolzoni
Sorry I am missing a bit, What is the problem of using sqlite3_backup again? On Thu, Jun 6, 2013 at 10:01 AM, Philip Bennefall wrote: > > - Original Message - From: "Simon Slavin" > To: ; "General Discussion of SQLite

Re: [sqlite] Force use SMALLINT datatype

2013-05-28 Thread Paolo Bolzoni
And double check that you actually VACUUM the db (manually or via auto vacuum). On Tue, May 28, 2013 at 4:23 PM, Richard Hipp wrote: > On Tue, May 28, 2013 at 10:15 AM, Wang, Gao wrote: > >> Dear all, >> >> I use sqlite to store, query and perform simple math

Re: [sqlite] Is pragma foreign_key_check fast enough to be used in normal application flow?

2013-05-25 Thread Paolo Bolzoni
To get answers in a similar situation I found useful the EXPLAIN QUERY PLAN command. On Fri, May 24, 2013 at 3:56 PM, kyan wrote: > On Fri, May 24, 2013 at 4:46 PM, Marc L. Allen > wrote: > >> It's exhaustive in that it absolutely verifies if

[sqlite] Savepoint and Begin Transaction, performance-wise

2013-05-17 Thread Paolo Bolzoni
In my programs I often use savepoints so in case of errors I can rollback leaving the db untouched. I use savepoint instead of begin transaction because it fits more naturally in the nested structure of a C program. When I write a function I do not need to recall if the caller already opened the

Re: [sqlite] sqlite shell: arrow keys

2013-05-17 Thread Paolo Bolzoni
maybe rlwrap can help? On Fri, May 17, 2013 at 4:27 AM, Fehmi Noyan ISI wrote: > Depends on your system I think. Here is what is contained in shell.c > readline.h is the thing making all those history and similar things you use > in your linux command line shell available.

Re: [sqlite] Scan table in explain query. Question.

2013-05-11 Thread Paolo Bolzoni
<clem...@ladisch.de> wrote: > Paolo Bolzoni wrote: >> sqlite> explain query plan SELECT id FROM tour LIMIT 1; >> 0|0|0|SCAN TABLE tour USING COVERING INDEX tour_unsorted_path_idx >> (~100 rows) >> >> I

[sqlite] Scan table in explain query. Question.

2013-05-11 Thread Paolo Bolzoni
sqlite> explain query plan SELECT id FROM tour LIMIT 1; 0|0|0|SCAN TABLE tour USING COVERING INDEX tour_unsorted_path_idx (~100 rows) I am not still sure I understand completely the output of explain query plan. But for sure, a small number

Re: [sqlite] SQL join with "or" condition gives unexpected results

2013-05-09 Thread Paolo Bolzoni
Seriously? Care to explain? On Thu, May 9, 2013 at 4:48 PM, Petite Abeille wrote: > > On May 9, 2013, at 3:30 PM, Romulo Ceccon wrote: > >> But my application is (so far) database agnostic > > Reconsider. Agnosticism is not a feature. It's a

Re: [sqlite] Index question

2013-04-28 Thread Paolo Bolzoni
Interesting, so sqlite3 is smart enough to actually move the blob instead of copying and deleting? If it is the case it is indeed great. On Sun, Apr 28, 2013 at 5:12 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 28 Apr 2013, at 3:51pm, Paolo Bolzoni <paolo.bolzoni.

Re: [sqlite] Index question

2013-04-28 Thread Paolo Bolzoni
PM, Richard Hipp <d...@sqlite.org> wrote: > On Sun, Apr 28, 2013 at 10:02 AM, Paolo Bolzoni < > paolo.bolzoni.br...@gmail.com> wrote: > >> I get this error: "cannot >> open indexed column for writing." >> >> What does it mean? >> >>

Re: [sqlite] Index question

2013-04-28 Thread Paolo Bolzoni
So I should write my BLOB in another (not-indexed) table, UPDATE the indexed table copying from the other, and finally delete the line in the first table? All in one transaction? On Sun, Apr 28, 2013 at 4:23 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 28 Apr 2013, at 3

Re: [sqlite] Index question

2013-04-28 Thread Paolo Bolzoni
Sorry, it seems gmail messed up the layout just before sending. On Sun, Apr 28, 2013 at 4:02 PM, Paolo Bolzoni <paolo.bolzoni.br...@gmail.com> wrote: > I was playing with indexes, I started checking one my queries with > EXPLAIN QUERY PLAN and > I got this result: > selectid

[sqlite] Index question

2013-04-28 Thread Paolo Bolzoni
I was playing with indexes, I started checking one my queries with EXPLAIN QUERY PLAN and I got this result: selectidorder fromdetail -- -- -- - 0 0 1

Re: [sqlite] What pragma to use to get maximum speed (at expense of safety)?

2013-04-27 Thread Paolo Bolzoni
he on-disk table. >> > >> > Make sure you're doing all of your inserts in a transaction. inserting is >> > pretty cheap, but committing a transaction is expensive, and if you're not >> > in a transaction each insert is its own transaction >> > >>

Re: [sqlite] What pragma to use to get maximum speed (at expense of safety)?

2013-04-26 Thread Paolo Bolzoni
own transaction > > Make sure you're re-using your prepared statements > > Play with page_size to get it right for your write patterns > > Don't use a connection concurrently, it's doing internal locking anyway. If > you must, use the shared page cache. If you're doing it from

[sqlite] What pragma to use to get maximum speed (at expense of safety)?

2013-04-26 Thread Paolo Bolzoni
The subject pretty much says it all, I use sqlite3 as a way to save temporary results from a calculation. In this context I do not care about safety of the data. If the program fails or there is a blackout I will just delete the sqlite3 file, eventually fix the bug, and restart. At the moment I

Re: [sqlite] Writing in a blob

2013-04-26 Thread Paolo Bolzoni
minique Devienne wrote: > >> On Mon, Apr 22, 2013 at 2:10 PM, Simon Slavin <slav...@bigfraud.org> wrote: >> >> > On 22 Apr 2013, at 12:39pm, Paolo Bolzoni wrote: >> > > But I noticed that sqlite3_blob_write cannot increase the size of the >> > point

Re: [sqlite] Writing in a blob

2013-04-22 Thread Paolo Bolzoni
It won't be as easy, but I guess I need to get the size of the gmp integer before so to allocate the blob and later writing in it. On Mon, Apr 22, 2013 at 2:10 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 22 Apr 2013, at 12:39pm, Paolo Bolzoni wrote: > &

[sqlite] Writing in a blob

2013-04-22 Thread Paolo Bolzoni
I have a table with a column of type BLOB, and I use a library that exports or imports its data structure writing or reading from a FILE*. (see the bottom of this page: http://gmplib.org/manual/I_002fO-of-Integers.html#I_002fO-of-Integers ) So my idea was creating a FILE* wrapper around

Re: [sqlite] sqlite abnormal IO writing

2013-04-21 Thread Paolo Bolzoni
FAQ 19 applies also to SAVEPOINT/RELEASE, not only to BEGIN/COMMIT, right? On Sun, Apr 21, 2013 at 9:35 AM, Kees Nuyt wrote: > On Sun, 21 Apr 2013 11:15:23 +0800 (CST), ?? > wrote: >> >> Ok,I do not make my means clearly. I mean 60 seconds after my >>

[sqlite] sqlite3_column_blob does not return the size of the blob?

2013-04-18 Thread Paolo Bolzoni
I need to save some blob (arbitrary precision numbers representations) on my sqlite3 database. And confused by the function: const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); I would expect an output parameter (example type size_t*) to get the size of the blob, but it is not there. How

[sqlite] sqlite3 or sqlite4 for a new project?

2013-04-17 Thread Paolo Bolzoni
Dear list, The subject pretty much says it all. I want to use sqlite in a small software I am writing, and I would like to know what are the reason of using sqlite3 or 4. The newer version seems quite an improvement, but as far as I can tell it not very used yet. What is the reason? It is not