[sqlite] Why operations with in-memory DB are much faster than with on-disk DB?

2018-10-18 Thread Yuri
I noticed that my DB import process is much slower when run on the DB on disk, vs. in memory. It reads files and runs a massive amount of inserts/updates. Why is this? Is there any way to speed it with disk without using in-memory DB? Yuri

Re: [sqlite] Violated failed foreign key constraint delays the rest of transaction ; Some foreign key violations don't trigger the error at all

2018-08-02 Thread Yuri
, if not, it fails. It doesn't need to check if another parent key already exists. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Violated failed foreign key constraint delays the rest of transaction ; Some foreign key violations don't trigger the error at all

2018-08-02 Thread Yuri
On 8/2/18 3:17 PM, Keith Medcalf wrote: .lint fkey-indexes and it will tell you what indexes you forgot to create that cause the issue you are seeing. But this problem isn't about a missing index. Yuri ___ sqlite-users mailing list sqlite

Re: [sqlite] Violated failed foreign key constraint delays the rest of transaction ; Some foreign key violations don't trigger the error at all

2018-08-02 Thread Yuri
of some queries, and should be handled reasonably. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Violated failed foreign key constraint delays the rest of transaction ; Some foreign key violations don't trigger the error at all

2018-08-01 Thread Yuri
the foreign key violation doesn't trigger the error at all. Please change VIOLATION to 0, and observe that there is no failure now, though it should be. sqlite3-3.24.0 on FreeBSD 11.2 Yuri ---testcase--- #include #include #include #include void doSql(sqlite3 *db, const char *sql

Re: [sqlite] Why some options (ex. SQLITE_ENABLE_EXPLAIN_COMMENTS, SQLITE_ENABLE_DBPAGE_VTAB) are permanently enabled in Makefile.am, but are documented as user-defined?

2018-03-13 Thread Yuri
On 03/13/18 02:05, Clemens Ladisch wrote: These options are used to compile the command-line shell (where you want to have as many (debugging) features as possible), and to assemble the amalgamation. Having two sets of build options is quite confusing. Yuri

[sqlite] Why some options (ex. SQLITE_ENABLE_EXPLAIN_COMMENTS, SQLITE_ENABLE_DBPAGE_VTAB) are permanently enabled in Makefile.am, but are documented as user-defined?

2018-03-13 Thread Yuri
-DSQLITE_ENABLE_DBSTAT_VTAB But all of these options (with -D) are documented here http://www.sqlite.org/compile.html as user-settable. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman

Re: [sqlite] SQLITE_ERROR ("SQL error or missing database") should be split into two codes: "SQL error" and "missing database"

2017-07-07 Thread Yuri
when database is corrupt/truncated? But there is SQLITE_CORRUPT for that. Short read mean EOF, and EOF in unexpected place constitutes corrupt database file. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.s

[sqlite] SQLITE_ERROR ("SQL error or missing database") should be split into two codes: "SQL error" and "missing database"

2017-07-07 Thread Yuri
Currently SQLITE_ERROR stands for two very different errors: > #define SQLITE_ERROR1 /* SQL error or missing database */ It would make sense to have separate codes for them to avoid possible confusion, because these two errors really have nothing in common. Y

Re: [sqlite] No public bug tracker?

2017-03-20 Thread Yuri
lem. ? Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] No public bug tracker?

2017-03-20 Thread Yuri
that I am logged in, but the bug site says I am not logged in. I am not sure if this is intentional. I assumed it was. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] configure --enable-shared doesn't build shared libraries

2017-03-20 Thread Yuri
Configure file says: > --enable-shared[=PKGS] build shared libraries [default=yes] However, shared library isn't built by default. This command: $ ./configure --enable-shared && gmake doesn't build it either. Yuri ___ sqlite-us

[sqlite] No public bug tracker?

2017-03-20 Thread Yuri
values are 0,1,2. There was no answer, while this appears to be a valid problem. Isn't it better to have a separate bug report for every issue? Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin

[sqlite] How to set SQLITE_THREADSAFE=2 through the configure arguments?

2017-03-10 Thread Yuri
this ability. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-08 Thread Yuri
not sure if this is the same bug, or another bug. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] [BUG REPORT] Open blob is invalidated by the update to unrelated fields in the same row

2017-03-06 Thread Yuri
eger field in the same row shouldn't affect the blob field. Rows can be very large and shouldn't move when individual fields are updated. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailma

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-05 Thread Yuri
On 03/05/2017 09:49, Simon Slavin wrote: On 5 Mar 2017, at 4:28pm, Yuri <y...@rawbw.com> wrote: So, to be clear, blob writes can only be used when no other statements are executed in the middle? Because the latest testcase only changes the other table, not the table where the blob is

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-05 Thread Yuri
you’re better off reading the existing BLOB value into memory using SELECT, editing it using standard memory-manipulation routines, then writing it back with an UPDATE when you’re ready. This is very slow. Yuri ___ sqlite-users mailing list sqlite

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-05 Thread Yuri
after sqlite3_blob_close. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-05 Thread Yuri
On 03/05/2017 03:48, Keith Medcalf wrote: Perhaps because you are committing the transaction? There is no COMMIT statement there. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-05 Thread Yuri
sqlite3_blob_write call, even though the added update statement is for the other table. Yuri #include #include #include "sqlite3.h" int breakMe = 1; char *exec_errmsg; void execSql(sqlite3 *db, const char *sql) { int rc; if (SQLITE_OK != (rc = sqlite3_exec(db, sql, NULL, NULL

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-04 Thread Yuri
, use case. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Not a Bug -- works as documented: [BUG REPORT] Open blob is invalidated by the update to unrelated fields in the same row

2017-03-04 Thread Yuri
nother bug is that reopening the blob every time is incredibly slow. Why is opening/closing the blob is so much slower? It also seems to get slower with the size of the data in the blob. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlit

[sqlite] [BUG REPORT] Open blob is invalidated by the update to unrelated fields in the same row

2017-03-03 Thread Yuri
The write operation using the open sqlite3_blob object fails after some other field in the same row is updated. The testcase below illustrates the problem. Yuri ---testcase--- #include #include #include "sqlite3.h" int main(int argc, char **argv) { i

Re: [sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-03 Thread Yuri
this in SQL fashion in an efficient way. So such command can be chained with other SQL statements and make the client code much simpler. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin

[sqlite] Can sqlite3_blob_write be done through SQL?

2017-03-01 Thread Yuri
that is supplied as the argument, and rewrite the whole blob otherwise? Also, do sqlite3_blob_write calls participate in transactions? Thanks, Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi

Re: [sqlite] Data loss during the disk full condition

2016-10-29 Thread Yuri
errors, but doesn't terminate the process. For some reason, Qt's db.lastError() doesn't print that text, but SQLite library prints it into stderr: > /usr/home/yuri/.config/in-mem-fs-to-test-disk-full: write failed, filesystem is full > QSqlSqliteSettingsFormat: database error occurred duri

Re: [sqlite] Data loss during the disk full condition

2016-10-29 Thread Yuri
On 10/29/2016 14:32, Simon Slavin wrote: On 29 Oct 2016, at 10:21pm, Yuri <y...@rawbw.com> wrote: I think you need to have such testcase: On the table with a lot of key/value pairs you run a set of updates and inserts. Random file operations should fail with some low probability with v

Re: [sqlite] Data loss during the disk full condition

2016-10-29 Thread Yuri
this file has been opened and written into again. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Data loss during the disk full condition

2016-10-29 Thread Yuri
interjects in between some open/read/write operations, so that some of them succeed and some subsequent ones fail, leaving something in unexpectedly wrong state. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http

Re: [sqlite] Data loss during the disk full condition

2016-10-29 Thread Yuri
On 10/29/2016 06:08, Simon Slavin wrote: On 29 Oct 2016, at 8:05am, Yuri<y...@rawbw.com> wrote: >The application is synchronizing the in-memory key-value table with the disk one using insert/update/delete statements using that key. The in-memory table was full at the moment

[sqlite] Data loss during the disk full condition

2016-10-29 Thread Yuri
-3.14.1 on FreeBSD. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] [BUG REPORT] Transaction that has the key violation is very slow

2016-09-20 Thread Yuri
), or keep going with the same speed. The way how it is now it just slows the process of finding a problem without any apparent reason. Yuri ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman

[sqlite] Why the parallel read of DB is faster with separate connections per thread?

2016-06-17 Thread Yuri
connection to slow the process down? In an attempt to speed it up as much as possible, I was trying to first copy into :memory: db, so that threads would read only from memory, but this requires the shared connection and it is slower. sqlite3-3.12.2 Yuri

[sqlite] SQLite scans the largest table in the query where a very small table is available

2016-01-20 Thread Yuri
, you still feel the need to improve over the query > planners' ordering, you can still use CROSS JOIN to force a certain order of > tables. ANALYZE helped, thanks! Yuri

[sqlite] SQLite scans the largest table in the query where a very small table is available

2016-01-20 Thread Yuri
e.w_id = w.w_id and h.e_id = e.e_id and m.h_id = h.h_id and mt.m_id = m.m_id group by e.w_id; Plan goes like this: 0|0|3|SCAN TABLE m AS m USING COVERING INDEX m_h_index 0|1|2|SEARCH TABLE h AS h USING INTEGER PRIMARY KEY (rowid=?) Yuri

[sqlite] 'order by' doesn't work with 'group_concat()'

2016-01-04 Thread Yuri
ncat(chr) from b where oid = a.id group by oid order by chr ) from a;" ---end--- It returns this dataset: 1|y,x 2|x,y The 'order by' clause doesn't work, because if it did the result would have been: 1|x,y 2|x,y sqlite3-3.9.2 Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-30 Thread Yuri
ENT|TRANSACTION];" It seems they currently work on the level of field writes and transactions, and not on SQL statement level. Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-18 Thread Yuri
RS type define so that you can get a better > edit/compile/run loop going in development, without being expensive in > production. Yes, such option can very nicely become a package option (on BSD). Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-18 Thread Yuri
s they become resolved they are counted down. At the end the > result is simply either that "some constraint failed" or "All resolved > eventually". Why not have two variants of the error message: one for immediate failure with the foreign key name, and one like now, for the complicated case of delayed constraints? Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-18 Thread Yuri
in all cases. Depends on what you do. It would have been great if it was an option, ex. "CONSTRAINT LEVEL [STATEMENT|TRANSACTION];". Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-18 Thread Yuri
t fail immediately. Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-17 Thread Yuri
nexpected, this is executed very rarely cntFailed++; if (!savedFailedID) savedFailedID = currentFailedID; // the only added line is } You only need to modify the slow branch. This has practically zero performance impact, in any case it is exactly zero for the non-failure operation. Yuri

[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-11-17 Thread Yuri
This message always leaves the user wondering: "Which constraint?" How hard is it to add this information to the message? Is this a matter of memorizing the ID of the constraint, and then printing its name in the message? Yuri

[sqlite] Easiest way to pass SQL query parameters in command line?

2015-11-05 Thread Yuri
d bind parameters. If sql could contain "kind=?", and sqlite3 could have for example --bind command to bind supplied values. Especially so if to consider that sqlite already supports prepared statements and binding. Yuri

[sqlite] Easiest way to pass SQL query parameters in command line?

2015-11-05 Thread Yuri
the environment variable, but such function doesn't seem to exist either. Yuri

[sqlite] Insertion into the large DB drastically slows down at some point

2015-08-28 Thread Yuri
key (definitely causing its violation). This triggered the slowdown behavior. I can't understand why exactly, because the primary key should have failed immediately, and the foreign key was deferred. But that's what happened. Yuri

[sqlite] Insertion into the large DB drastically slows down at some point

2015-08-27 Thread Yuri
everal "uniq" constraints, also added to be used by inserts. Without indexes/uniq constrainst it will slow down, and plans will show table scans. Yuri

[sqlite] Insertion into the large DB drastically slows down at some point

2015-08-27 Thread Yuri
s that at the time of the event in question size of the process increases by 5MB. Yuri

[sqlite] Insertion into the large DB drastically slows down at some point

2015-08-27 Thread Yuri
(x,x,x) values(?,?,?)" Selects are also all simple one-table selects. All statements used in prepared form. How can I understand why the slowdown occurs? Especially, why the slowdown in so "sharp"? Something drastic happens, like some strategy is recomputed, some index is rebuilt, etc... Thank you, Yuri

[sqlite] System.Data.SQLite.SQLiteConnection throwing NotSupportedException on WinCE 6.0 (CF 3.5)

2012-10-10 Thread Yuri Korolyov
Hello, When using System.Data.SQLite under WinCE 6.0 + Compact Framework 3.5, it is not possible to get some of SQLiteConnection properties, namely, LastInsertRowId, MemoryUsed, MemoryHighwater because NotSupportedException is thrown. All three properties mentioned fail when calling native

Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-07 Thread Yuri G
ecute the second select to retrieve the > remaining rows you need. > > > Pavel > > On Wed, Oct 6, 2010 at 12:22 PM, Yuri G <groovy...@gmail.com> wrote: > > Hi, everyone, > > > > This looks like a bug to me: > > > > --sql: > > >

Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-07 Thread Yuri G
Thanks, Igor. It works like a charm now. 2010/10/6 Igor Tandetnik <itandet...@mvps.org> > Yuri G <groovy...@gmail.com> wrote: > > This looks like a bug to me: > > > > --sql: > > > > CREATE TABLE t(a INTEGER); > > > > INSERT INTO "t

[sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-06 Thread Yuri G
Hi, everyone, This looks like a bug to me: --sql: CREATE TABLE t(a INTEGER); INSERT INTO "t" VALUES(1); INSERT INTO "t" VALUES(2); INSERT INTO "t" VALUES(3); INSERT INTO "t" VALUES(4); SELECT * FROM ( SELECT a FROM t WHERE a<=2 ORDER BY a) UNION ALL SELECT * FROM ( SELECT