Re: [sqlite] Why doesn't SQLite optimise this subselect?

2018-01-06 Thread Dinu
If you want just 1 value (any) from lookup, you can use: SELECT post_processing_info, ( SELECT is_json FROM tables_lookup WHERE tables_lookup.content_hash=webpage_contents.content_hash LIMIT 1 ) AS is_json FROM

Re: [sqlite] Why doesn't SQLite optimise this subselect?

2018-01-06 Thread Dinu
Could you describe your intent in more detail? SELECT * FROM ... GROUP BY is unstable at best, so I cannot really grasp your intention. Which lookup record's If I guess right, you might want something in the lines of: SELECT w.post_processing_info, l.is_json FROM webpage_conte

[sqlite] Why doesn't SQLite optimise this subselect?

2018-01-06 Thread Jonathan Moules
Hi All, This is more of an academic question as I've come up with a better query, but I was wondering why SQLite doesn't optimise this query. Lets say I have two tables, simplified here. One contains webpage contents and a unique hash of those contents (the primary key), the other contains