Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes

2019-12-03 Thread Jonathan Moules
Thanks for the suggestion. Changing the USING to ON makes absolutely no difference. The speed is the same and the query plans (both EXPLAIN and EXPLAIN QUERY PLAN) are absolutely identical. Same for if I convert it to WHERE: WHERE joining_table.data_id = data_table.data_id; On 2019-12-03 14:4

Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes

2019-12-03 Thread Simon Slavin
On 3 Dec 2019, at 8:48am, Jonathan Moules wrote: > SELECT > count(1) > FROM > data_table > JOIN joining_table USING (data_id); SELECT count(1) FROM data_table JOIN joining_table ON joining_table.data_id = dat

Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes

2019-12-03 Thread Jonathan Moules
d disk? If you analyze and vacuum it does it get any better? I think the CLI has something like ".scanstats on" to get a little more info, but I'm not sure how much more info it'll provide. -Original Message----- From: sqlite-users On Behalf Of Hick Gunter Sent:

Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes

2019-12-02 Thread Jonathan Moules
f Hick Gunter Sent: Tuesday, November 26, 2019 4:57 AM To: 'SQLite mailing list' Subject: Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes You are using text columns as primary keys and referencing them directly in foreign keys. This is probably not what you want, because it

Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes

2019-11-26 Thread David Raymond
he CLI has something like ".scanstats on" to get a little more info, but I'm not sure how much more info it'll provide. -Original Message- From: sqlite-users On Behalf Of Hick Gunter Sent: Tuesday, November 26, 2019 4:57 AM To: 'SQLite mailing list' Subje

Re: [sqlite] [EXTERNAL] Slow joining of tables with indexes

2019-11-26 Thread Hick Gunter
You are using text columns as primary keys and referencing them directly in foreign keys. This is probably not what you want, because it duplicates the text key. Also, with foreign keys enabled, your join is not accomplishing anything more than a direct select from joining_table, just with more