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:
>
> >
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
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
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)
);
4 matches
Mail list logo