Re: [sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Richard Hipp
On 5/3/19, Manuel Rigger wrote: > I just tried the examples on the int-real branch, > and it seems that they do not cause any errors. > The int-real branch has now been fully tested and merged to trunk. -- D. Richard Hipp d...@sqlite.org ___

Re: [sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Manuel Rigger
Unfortunately, I deleted some other similar cases that I found before reading your reply. I'll gather any new cases (I assume you are talking about cases that the int-real branch should address). Best, Manuel On Fri, May 3, 2019 at 2:34 PM Richard Hipp wrote: > On 5/3/19, Manuel Rigger wrote:

Re: [sqlite] Query planner: Covering index not chosen over primary key

2019-05-03 Thread Jen Pollock
Thank you for the suggestion! The actual schema & query are a good deal more complicated, and I'm not looking for general optimization help with them right now. Jen Pollock On Fri, May 03, 2019 at 10:11:04PM +0100, Simon Slavin wrote: > On 3 May 2019, at 9:34pm, Jen Pollock wrote: > > >

Re: [sqlite] Query planner: Covering index not chosen over primary key

2019-05-03 Thread Simon Slavin
On 3 May 2019, at 9:34pm, Jen Pollock wrote: > SELECT filename > FROM images >JOIN embedded_files ON images.file_id == embedded_files.id > WHERE type == 'png'; Try this: CREATE INDEX images (type, file_id); ANALYZE; ___ sqlite-users mailing

Re: [sqlite] Query planner: Covering index not chosen over primary key

2019-05-03 Thread Richard Hipp
On 5/3/19, Jen Pollock wrote: > I assume the problem here is that the primary key is usually a weird > thing to index. I can definitely work around this, but I thought it > might be worth reporting as something that could perhaps be improved in > the query planner. Thank you. I have your

[sqlite] Query planner: Covering index not chosen over primary key

2019-05-03 Thread Jen Pollock
I have a database with a schema roughly like this: CREATE TABLE embedded_files( id INTEGER PRIMARY KEY, filename TEXT, data BLOB ); CREATE TABLE images( id INTEGER PRIMARY KEY, file_id INTEGER, type TEXT, FOREIGN KEY(file_id) REFERENCES embedded_files(id) );

Re: [sqlite] Error when renaming a table when an invalid view exists in the schema

2019-05-03 Thread Keith Medcalf
Use PRAGMA LEGACY_ALTER_TABLE=ON; The "Legacy alter table" does not require the database to be "valid/consistent" after executing the "alter table" command. The non-legacy (default) mode requires that the database be "transformed" into a "valid/consistent" state in order for the alter table

[sqlite] Error when renaming a table when an invalid view exists in the schema

2019-05-03 Thread Tom Bassel
Hello again everyone, I went through the ALTER TABLE docs but could not find anything describing this behavior: SQLite version 3.29.0 2019-04-27 20:30:19 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite>

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread Richard Hipp
On 5/3/19, Jens Alfke wrote: > > Thanks, Simon. So the rekey is expected to double the database file size? Database size should be the same before and after rekey. The rekey operation will generate journal file entries that are about the same size as the original database (actually slightly

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread Pasin Suriyentrakorn
Thanks Simon, for the answer. David, sqlite3_rekey_v2() is a function to change the database encryption key - it's a SEE feature. On Fri, May 3, 2019 at 9:56 AM Jens Alfke wrote: > > > > On May 3, 2019, at 8:37 AM, Simon Slavin wrote: > > > > While rekey is working, the database temporarily

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread Simon Slavin
On 3 May 2019, at 5:56pm, Jens Alfke wrote: > Thanks, Simon. So the rekey is expected to double the database file size? > That’s good to know. I don't know for sure. I believe that the rekeying is done block by block rather than for the entire database at one time. > After the call

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread Jens Alfke
> On May 3, 2019, at 8:37 AM, Simon Slavin wrote: > > While rekey is working, the database temporarily contains both sets of some > data. Automatic crash recovery will see, this, recover the unconverted set, > and wipe the converted set. You do not need to take special precautions.

Re: [sqlite] Go & SQLite asserts

2019-05-03 Thread Jens Alfke
> On May 3, 2019, at 3:06 AM, Rowan Worth wrote: > > But there's a very clear > convention set out surrounding the use of panic() - it should never form > part of a module's public API. It's not an error reporting mechanism and > callers should never be expected to invoke recover() just to use

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread J. King
It's part of the encryption extension. The function signature is referenced publicly here: -- J. King On 2019-05-03 12:04:32, "David Raymond" wrote: Random question from a non-C person: What is sqlite3_rekey_v2()? I was curious, so

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread David Raymond
Random question from a non-C person: What is sqlite3_rekey_v2()? I was curious, so looked for it in the docs and don't see it listed in the C reference... https://www.sqlite.org/c3ref/funclist.html ...and it doesn't get any hits when put into the search box for the web page. -Original

Re: [sqlite] [EXTERNAL] Re: seeking information on the throughput requirement using Sqlite

2019-05-03 Thread David Raymond
Which again goes to the hardware question. If your database is on "spinning rust" as people call it, you can't commit a transaction (that changed the data) any quicker than 2 rotations of the physical disk, because the data needs to get synced to the disk before the next write transaction can

Re: [sqlite] Please remove my email address from the list

2019-05-03 Thread Simon Slavin
On 3 May 2019, at 4:34pm, Jean Marcoux wrote: [nothing] Please click on the link at the bottom of every post, including this one, and remove yourself. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread Simon Slavin
On 3 May 2019, at 4:15pm, Pasin Suriyentrakorn wrote: > What could happen if an app crashes while calling sqlite3_rekey_v2()? Is > there best practice to safely call sqlite3_rekey_v2()? While rekey is working, the database temporarily contains both sets of some data. Automatic crash recovery

[sqlite] Please remove my email address from the list

2019-05-03 Thread Jean Marcoux
___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] [EXTERNAL] Re: seeking information on the throughput requirement using Sqlite

2019-05-03 Thread Simon Slavin
On 3 May 2019, at 4:26pm, Zhu, Liang [AUTOSOL/ASSY/US] wrote: > The planning transition rate is 1ms per 34-40Kb data, we only have one > connection trying to write to the database. If we have two connection, will > we running to database concurrency issue? If you have normal hardware,

Re: [sqlite] SQLite windows function support

2019-05-03 Thread Richard Hipp
On 5/3/19, Chien-Chih Yu wrote: > Since all current window functions are "draft version"... I'm not sure were you are getting this information. See https://www.sqlite.org/windowfunctions.html for the official documentation. Ahead of each release, we always publish advance copies of the new

[sqlite] What could happen if an app crashes while calling sqlite3_rekey_v2()?

2019-05-03 Thread Pasin Suriyentrakorn
Hello, What could happen if an app crashes while calling sqlite3_rekey_v2()? Is there best practice to safely call sqlite3_rekey_v2()? Thanks, Pasin ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] [EXTERNAL] Re: seeking information on the throughput requirement using Sqlite

2019-05-03 Thread Zhu, Liang [AUTOSOL/ASSY/US]
The planning transition rate is 1ms per 34-40Kb data, we only have one connection trying to write to the database. If we have two connection, will we running to database concurrency issue? Thank you, Liang -Original Message- From: sqlite-users On Behalf Of David Raymond Sent:

[sqlite] SQLite windows function support

2019-05-03 Thread Chien-Chih Yu
To whom it may concern We are evaluating the use of SQLite window functions. Since all current window functions are "draft version", we would like to know when these window functions will become stable version. Thanks Chien-Chih Yu This email and any attachments are intended for the sole use of

Re: [sqlite] seeking information on the throughput requirement using Sqlite

2019-05-03 Thread David Raymond
Within a single transaction SQLite can do things very quickly. But a reminder that there can be only 1 write transaction happening at a time. So my questions are: What is the planned _transaction_ rate? And how many different connections will be trying to write at once? -Original

Re: [sqlite] seeking information on the throughput requirement using Sqlite

2019-05-03 Thread Stephen Chrzanowski
All of that is going to ENTIRELY depend on your hardware, and how fast it's going to allow the electrical pulses and actual processing of the different chips on your mobo, and the kind of data you're going to be adding, requesting, and removing. There's no clear-cut answer with the information

Re: [sqlite] seeking information on the throughput requirement using Sqlite

2019-05-03 Thread Simon Slavin
On 3 May 2019, at 3:01pm, Zhu, Liang [AUTOSOL/ASSY/US] wrote: > In my current project, we have the need to inserting and deleting data to and > from the database between 1 and 10 ms for 24/7. I am seeking the > clarification on the following questions > > 1. what is the throughput

[sqlite] seeking information on the throughput requirement using Sqlite

2019-05-03 Thread Zhu, Liang [AUTOSOL/ASSY/US]
Hi Sqlite experts, In my current project, we have the need to inserting and deleting data to and from the database between 1 and 10 ms for 24/7. I am seeking the clarification on the following questions 1. what is the throughput requirements are possible using Sqlite API?, in other

Re: [sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Richard Hipp
On 5/3/19, Manuel Rigger wrote: > I just tried the examples on the int-real branch, > and it seems that they do not cause any errors. That is good to hear. It would be helpful if you could gather together all of your test cases and send them to us, so that we could add them to the SQLite

Re: [sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Manuel Rigger
Thanks for the feedback! I just tried the examples on the int-real branch, and it seems that they do not cause any errors. So I guess these two examples can be considered to be duplicate bug reports of my "Index on REAL column malfunctions when multiplying with a string" email. Best, Manuel On

Re: [sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Richard Hipp
On 5/3/19, Manuel Rigger wrote: > I found another similar example with GLOB: > > CREATE TABLE test (c0 REAL); > CREATE UNIQUE INDEX index_0 ON test(('0' GLOB -c0)); > INSERT INTO test(c0) VALUES (1.0), (0.0); > REINDEX; > > Is the issue related to the implementation of the unary minus operator >

Re: [sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Manuel Rigger
I found another similar example with GLOB: CREATE TABLE test (c0 REAL); CREATE UNIQUE INDEX index_0 ON test(('0' GLOB -c0)); INSERT INTO test(c0) VALUES (1.0), (0.0); REINDEX; Is the issue related to the implementation of the unary minus operator (i.e., do both examples trigger the same bug)?

[sqlite] Index on REAL malfunctions in combination with the LENGTH function

2019-05-03 Thread Manuel Rigger
Hi, I found another very specific corner case for which an index fails ("UNIQUE constraint failed: index 'index_0'"): CREATE TABLE test (c0 REAL); CREATE UNIQUE INDEX index_0 ON test(LENGTH(-c0)); INSERT INTO test(c0) VALUES (0.0), ('10:'); REINDEX; Best, Manuel

Re: [sqlite] Bug report: Segfault in sqlite3_clear_bindings when statement is nullptr

2019-05-03 Thread Christof Arnosti
Hi, Since the last mail I sent was not really readable due to problems with my mail settings I resend the possible bug report below. I want to report a (possible) bug in sqlite3. When sqlite3_clear_bindings is called with a nullptr argument, then a SEGFAULT occurs. From the behavior of the

Re: [sqlite] Go & SQLite asserts

2019-05-03 Thread Rowan Worth
On Fri, 3 May 2019 at 16:03, Dominique Devienne wrote: > On Mon, Apr 29, 2019 at 9:49 PM Russ Cox wrote: > > > On Mon, Apr 29, 2019 at 3:28 PM Richard Hipp wrote: > > For what it's worth, it was not clear to me until just now that the > article > > existed to push back on a general "asserts

Re: [sqlite] Go & SQLite asserts

2019-05-03 Thread Dominique Devienne
On Mon, Apr 29, 2019 at 9:49 PM Russ Cox wrote: > On Mon, Apr 29, 2019 at 3:28 PM Richard Hipp wrote: > For what it's worth, it was not clear to me until just now that the article > existed to push back on a general "asserts considered harmful" notion. I > was reading it as primarily