Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Dan Kennedy
On May 27, 2010, at 8:07 PM, Pavel Ivanov wrote: >> That's true, except for the case when exclusive lock fails; at >> least that's >> what Dan Kennedy says to my question from a couple of years ago: >> http://old.nabble.com/changes-in-cache-spill-locking-since-3.5.9--td20564357.html#a20564357 >

Re: [sqlite] round documentation

2010-05-27 Thread Matt Young
OK, got it. I was referring to the number of decimal points, but yes round(x,0) does do something On 5/27/10, Igor Tandetnik wrote: > Matt Young wrote: >> Round(x,0) really doesn't exist, it simply does round(x,1) > > select round(4.1, 0), round(4.1, 1); > 4.04.1 > > -- > Igor Tandetnik > >

Re: [sqlite] round documentation

2010-05-27 Thread Igor Tandetnik
Matt Young wrote: > Round(x,0) really doesn't exist, it simply does round(x,1) select round(4.1, 0), round(4.1, 1); 4.04.1 -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sql

Re: [sqlite] round documentation

2010-05-27 Thread Matt Young
sqlite> select round(4.-.5); 4.0 sqlite> select round(4.-0); 4.0 sqlite> select round(4); 4.0 sqlite> select round(4,0); 4.0 sqlite> select round(4,1); 4.0 sqlite> select round(4,2); 4.0 sqlite> select round(4.666,2); 4.67 sqlite> Round(x,0) really doesn't exist, it simply does round(x,1) On 5/

Re: [sqlite] round documentation

2010-05-27 Thread Igor Tandetnik
Matt Young wrote: > I second that documentation confusion. There is no truncate to > integer, though I wish it would. Somewhat off-topic, but if you want truncation, this would do it: round(x - 0.5) . Well, it's more like floor(), it goes down rather than towards zero (which makes a difference

Re: [sqlite] round documentation

2010-05-27 Thread Matt Young
I second that documentation confusion. There is no truncate to integer, though I wish it would. On 5/27/10, Wilson, Ronald wrote: > From http://www.sqlite.org/lang_corefunc.html > > "The round(X,Y) function returns a string representation of the > floating-point value X rounded to Y digits to th

[sqlite] UPDATE VIEW ... LIMIT 1; -- apparently no effect?

2010-05-27 Thread Ralf Junker
This is SQLite 3.6.23.1 compiled with SQLITE_ENABLE_UPDATE_DELETE_LIMIT (plus a few others, which should not matter to the problem). The UPDATE ... LIMIT clause works fine when applied to tables, but suppresses any updates when applied to a view with an update trigger. Here is some example SQL:

Re: [sqlite] Problem with SQLite library.

2010-05-27 Thread Pavel Ivanov
> Error is " error C3861: 'sqlite_open': identifier not found". Indeed there's no sqlite_open function. There's sqlite3_open. Does it fixes the problem? Pavel On Thu, May 27, 2010 at 11:31 AM, lukasz aaa wrote: > Hello. Sorry for my English. > I have a problem with the SQLite library reloaded

Re: [sqlite] network access problem

2010-05-27 Thread Pavel Ivanov
> a)  There are no other processes or connections accessing this db. There are > no journals or writing being done to any db across this or any connection.   > Both in the virtual world and the host pc. You didn't get Roger's words correctly. Although you don't have any other processes or journal

[sqlite] Problem with SQLite library.

2010-05-27 Thread lukasz aaa
Hello. Sorry for my English. I have a problem with the SQLite library reloaded correctly (use in project). I'm using VC++ 2010 and Dev. I add to project sqlite3.h, copy to folder with source sqlite3.dll and sqlite3.lib. I add sqlite3.lib to linker - i search information on forums, but can't comp

[sqlite] small bug using like/glob without wildcard?

2010-05-27 Thread ge...@iol.it
Dear all, I'm looking to resolve a small problem using like/glob function with indexes starting from version 3.6.23.1 (It worked with 3.6.13) Using a where condition such as "WHERE MY_INDEXED_COLUMN LIKE 'X' " ,sqlite doesn't use the index on that column while it uses the index if I use a wild

[sqlite] round documentation

2010-05-27 Thread Wilson, Ronald
>From http://www.sqlite.org/lang_corefunc.html "The round(X,Y) function returns a string representation of the floating-point value X rounded to Y digits to the right of the decimal point. If the Y argument is omitted, the X value is truncated to an integer." The documentation above is incorrec

Re: [sqlite] network access problem

2010-05-27 Thread Art
a) There are no other processes or connections accessing this db. There are no journals or writing being done to any db across this or any connection. Both in the virtual world and the host pc. b) Running windows xp pro 32bit in VB. Parent PC is windows 7 ultimate 64 bit. c) Yes, when the f

Re: [sqlite] Aggregate and join query very slow

2010-05-27 Thread Max Vlasov
On Thu, May 27, 2010 at 3:07 PM, Michael Ash wrote: > ...These are large tables (52,355 records in facility and 4,085,137 in > release_cl). > > ... > sqlite> explain query plan > ...> SELECT name,score > ...> FROM facility f, (SELECT facilitynumber,SUM(score_rev) AS score > ...> FRO

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Pavel Ivanov
> That's true, except for the case when exclusive lock fails; at least that's > what Dan Kennedy says to my question from a couple of years ago: > http://old.nabble.com/changes-in-cache-spill-locking-since-3.5.9--td20564357.html#a20564357 It's interesting feature, I didn't know about that. It woul

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Igor Sereda
Pavel, Thanks for the reply! I was afraid using pcache would be the only way :) As for this: Pavel Ivanov-2 wrote: > > No way. Cache won't ever grow just because you have large transaction. > It will only be spilled to disk and exclusive lock will be taken but > never trigger unbound growth.

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Pavel Ivanov
> And when the amount of data changed in a single transaction is large enough, > it would cause either cache spill and exclusive lock on the database, or the > growth of cache and memory consumption. No way. Cache won't ever grow just because you have large transaction. It will only be spilled to

Re: [sqlite] Aggregate and join query very slow

2010-05-27 Thread Black, Michael (IS)
MySql has a much larger default cache than sqlite3. That could be one rather large difference in performance. Try increasing sqlite3 cache from it's default of 2000k PRAGMA cache_size=10; Or more... Also...no indexes on media or year? And what does MySql's explain say? Michael D. Bla

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Black, Michael (IS)
Maybe I'm confused but perhaps you don't understand the pseudo code or I don't understand your problem. The idea is to process in batches instead of all-at-once. I don't see where you came up with 1,000,000 inserts as though the pseudo-code is generating extra insert statements for you. If yo

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Igor Sereda
Michael, Thank you for your suggestion! The problem with this approach is that N would not be a constant that we could tune. As I mentioned, the amount of updates may vary, depending on the data received. For example, one piece of data may lead to a single INSERT. So it would be safe and effec

[sqlite] Aggregate and join query very slow

2010-05-27 Thread Michael Ash
I am new to sqlite3, converting from mysql. A query that involves an aggregate function and a join is running very slowly (taking about 15 seconds compared to mysql where it runs in <1 second). I've tried two variants of the query (each reprinted below with the explain query plan), and both are

[sqlite] How to get a constraint name

2010-05-27 Thread Дамян Богоев
Hi, I want find out how to get a foreign key constraint name stored in a sqlite database. Could you assist me with this problem? Thank you in advance. *Damyan Bogoev* ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/c

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Black, Michael (IS)
So only do N many records in one batch. That's the easiest thing. Forget about the cache and just use responsiveness to adjust how many records you allow at once. Pseudo-code: recnum=0 BEGIN; while more records INSERT recnum++ if (recnum % 1000) COMMIT; BEGIN;

Re: [sqlite] network access problem

2010-05-27 Thread Black, Michael (IS)
One thing to be clear on. What OS are you running in your Virtualbox? I hope it's not unix-flavored as that could/would be your problem. Also...you didn't say that read/write worked over the UNC path...only that read-only failed. Michael D. Black Senior Scientist Northrop Grumman Mission S

[sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Igor Sereda
I would like each transaction to be as large as possible, but not too large to cause cache growth or cache spill. We have a stream of incoming data, with each piece of data causing updates in SQLite database. The number of rows inserted/updated for each data record may vary. If I enclose each da