Re: [sqlite] Query planner: Scanning subqueries vs using automatic covering index

2019-03-15 Thread Keith Medcalf
Of course, the correlated version returns all books, not just the ones that have at least one author, were read at least once, and have at least one genre. --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original

Re: [sqlite] Query planner: Scanning subqueries vs using automatic covering index

2019-03-15 Thread Keith Medcalf
The current tip of trunk produced the same results demonstrated by Niklas in his original post for his original testcase for me. I would have written the query as a simple query with correlated subqueries to get the concatenated data as it is a "more natural" declaration of what is wanted (in

Re: [sqlite] [EXTERNAL] Re: Missing docs

2019-03-15 Thread Joshua Thomas Wise
Sure it’s documented in the release log, but it’s not documented in the C-API (https://sqlite.org/c3ref/expanded_sql.html), and it’s not documented among every other compile-time option (https://www.sqlite.org/compile.html). I don’t know why you listed that second link. It doesn’t mention anythi

Re: [sqlite] Query planner: Scanning subqueries vs using automatic covering index

2019-03-15 Thread Simon Slavin
On 15 Mar 2019, at 7:35am, niklas wrote: > Dropping analyze (sqlite_stat1) information from the database made > the problem go away, i.e. made sqlite use index instead of scanning. Instead of dropping ANALYZE information, did you try updating it instead, by running ANALYZE again ? Ah ... >

[sqlite] Query planner: Scanning subqueries vs using automatic covering index

2019-03-15 Thread niklas
I recently noticed some very slow queries for my sqlite book database. Turns out that it happened due to the query planner decided to scan sub-queries instead of using an automatic covering index to search them. The database contains about 3000 entries and with two subqueries it took a noticab

Re: [sqlite] [EXTERNAL] Re: Missing docs

2019-03-15 Thread Hick Gunter
Actually It is documented See https://sqlite.org/changes.html look for release 3.26.0 and https://sqlite.org/c3ref/expanded_sql.html and https://sqlite.org/releaselog/3_26_0.html where the compile option is mentioned -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun.

Re: [sqlite] Missing docs

2019-03-15 Thread Joshua Thomas Wise
Yes sorry, it was a erroneous copy-paste. I was referring to sqlite3_normalized_sql(). As Keith said, it’s only available if the SQLITE_ENABLE_NORMALIZE compile option is used, but that is not documented anywhere. > On Mar 15, 2019, at 3:56 AM, Keith Medcalf wrote: > > > These docs: > > ht

Re: [sqlite] Malformed schema (orphan index) on particular db with the version 3.27.2

2019-03-15 Thread Richard Hipp
On 3/15/19, Max Vlasov wrote: > > But 3.27.2 said > malformed database schema ({sqlite_autoindex_mytablename}_1) - orphan > index. This error message arises from enhanced early detection of corrupt database files that was added to version 3.27.x. Do you still have the original database, before

[sqlite] Malformed schema (orphan index) on particular db with the version 3.27.2

2019-03-15 Thread Max Vlasov
Hi, I have a database that used in software since probably 2010, there are many variants of this database at my hd and everything was fine with it starting 3.6.10 through 3.26.00, I'm not sure about every version, but during the version history, at least several was used to open it. But 3.27.2 sa

Re: [sqlite] Corruption of database when renaming a table

2019-03-15 Thread Richard Hipp
On 3/15/19, Scott Perry wrote: > The behaviour of ALTER TABLE changed in 3.25.0 and breaks compatibility with > many existing applications. Your statements (corrected for use of single > quotes, as Ryan mentioned) work for me when `PRAGMA legacy_alter_table=1;`. All true. But even so, SQLite sho

Re: [sqlite] Corruption of database when renaming a table

2019-03-15 Thread Scott Perry
The behaviour of ALTER TABLE changed in 3.25.0 and breaks compatibility with many existing applications. Your statements (corrected for use of single quotes, as Ryan mentioned) work for me when `PRAGMA legacy_alter_table=1;`. More info on SQLite's website: https://www.sqlite.org/lang_altertable.

Re: [sqlite] Corruption of database when renaming a table

2019-03-15 Thread tjerzyko
Link to my database in in the original post. https://drive.google.com/file/d/1RCPoPgoLdc2VgF2uX2zPFrkheFi9z3b_/view?usp=sharing Tomasz Jerzykowski W dniu 2019-03-15 14:46:19 użytkownik R Smith napisał: > For a start, do not use single quotes for table names. In SQL, DB object > identifiers can

Re: [sqlite] Corruption of database when renaming a table

2019-03-15 Thread R Smith
For a start, do not use single quotes for table names. In SQL, DB object identifiers can either be unquoted or contained in double-quotes. SQLite specifically even allows backticks or square brackets for compatibility, but nobody likes single quotes. I.e. change this: drop table 'fs_params_20

Re: [sqlite] difference between *.db *.db3 *.sqlie2 *.slite3

2019-03-15 Thread Simon Slavin
On 15 Mar 2019, at 10:29am, Mohsen Pahlevanzadeh wrote: > What differ between *.db *.db3 *.sqlie2 *.slite3 files? Be very careful of .sqlite2 files. The name suggests an obsolete version of SQLite that is incompatible with everything from the last decade. Apart from that, SQLite databases ca

[sqlite] Corruption of database when renaming a table

2019-03-15 Thread tjerzyko
I'm having corruption problem with a certain database file. You can download it here: https://drive.google.com/file/d/1RCPoPgoLdc2VgF2uX2zPFrkheFi9z3b_/view?usp=sharing It was created with SQLite 3.8.7 or older version (I cannot say for sure now) I open it with sqlite3.exe and run the following sc

Re: [sqlite] sqlite.org has expired ssl cert

2019-03-15 Thread Richard Hipp
On 3/15/19, Wout Mertens wrote: > it expired in January… Looks like the Let's Encrypt client isn't > auto-updating the certificates. I got a new cert yesterday, or maybe the day before, and it was working fine. Then overnight, something happened to revert the cert to one from last year. I'm not

Re: [sqlite] difference between *.db *.db3 *.sqlie2 *.slite3

2019-03-15 Thread Shawn Wagner
A sqlite database is just a file. You can name it whatever you want. People who like file extensions often use such ones (I assume you meant .sqlite2 and .sqlite3? The first would likely be used to indicate a sqlite 2 database, assuming you can find any software that still uses it...) On Fri, Mar

Re: [sqlite] mysql to sqlite

2019-03-15 Thread Wout Mertens
SQLite doesn't enforce types, but it does accept them. They're documented at https://www.sqlite.org/datatype3.html Basically, you want INTEGER and TEXT. There's no date type. I recommend storing those as epoch integer, or in ISO text format, so that they're easy to parse and sort correctly. Wout

[sqlite] sqlite.org has expired ssl cert

2019-03-15 Thread Wout Mertens
it expired in January… Looks like the Let's Encrypt client isn't auto-updating the certificates. Wout. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] difference between *.db *.db3 *.sqlie2 *.slite3

2019-03-15 Thread Mohsen Pahlevanzadeh
What differ between *.db *.db3 *.sqlie2 *.slite3 files? ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] mysql to sqlite

2019-03-15 Thread Mohsen Pahlevanzadeh
Hello, I have some tables in mysql with the following data types: smallint text varchar date I don't know sqlite, What are corresponding above data types in sqlite? --Regards Mohsen ___ sqlite-users mailing list sqlite-users@mailinglists.sql

Re: [sqlite] Missing docs

2019-03-15 Thread Keith Medcalf
These docs: https://sqlite.org/c3ref/expanded_sql.html The sqlite3_sql and sqlite3_expanded_sql are always be available. The sqlite3_normalized_sql interface is only available if the SQLITE_ENABLE_NORMALIZE compile option is used. --- The fact that there's a Highway to Hell but only a Stair

Re: [sqlite] [EXTERNAL] Missing docs

2019-03-15 Thread Shawn Wagner
Or just boring old autocorrect shenanigans... On Fri, Mar 15, 2019, 12:20 AM Hick Gunter wrote: > Which release of sqlite are you referrring to? I am unaware of any > function call with a prefix of sqldark in release 3.24? Maybe this is an > addon/wrapper/whatever from the Sith? > > -Ursprün

Re: [sqlite] [EXTERNAL] Missing docs

2019-03-15 Thread Hick Gunter
Which release of sqlite are you referrring to? I am unaware of any function call with a prefix of sqldark in release 3.24? Maybe this is an addon/wrapper/whatever from the Sith? -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag