-
Notifications
You must be signed in to change notification settings - Fork 376
redesign of updateStandaloneArtwork() #1637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: artwork-scan-db
Are you sure you want to change the base?
Changes from 3 commits
50c8587
af8169b
4da574e
6a5a6bd
7c62c4d
faafb9f
d6932bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,20 @@ CREATE INDEX scannedUrlIndex ON scanned_files (url); | |
|
|
||
| DROP TABLE IF EXISTS scanned_pics; | ||
| CREATE TABLE scanned_pics ( | ||
| url text NOT NULL, | ||
| folder text, | ||
| full_path text NOT NULL, | ||
| timestamp int(10), | ||
| filesize int(10) | ||
| filesize int(10), | ||
| coverid char(8), | ||
| status char(1) CHECK (status IN ('D', 'E', 'N')) | ||
| -- D = image deleted (ie used in the database (tracks.cover) but no longer existing on disk) | ||
| -- E = an existing image present in tracks.cover | ||
| -- N = a new image (eg on disk but not used in tracks.cover - might actually have been on disk before, but passed over in a previous scan) | ||
| -- NULL = we'll set status 'E' to NULL if after n&c music files have been processed the image is still being used. | ||
| -- This improves performance as we'll only process the tracks if there's also a N(ew) image | ||
| ); | ||
| CREATE INDEX scannedPicUrlIndex ON scanned_pics (url); | ||
| CREATE INDEX scannedPicUrlIndex ON scanned_pics (full_path); | ||
| CREATE INDEX scannedPicDirIndex ON scanned_pics (folder); | ||
| create index scannedPicStatusidx on scanned_pics(status); | ||
|
Comment on lines
+23
to
+25
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think SQLite would only use one index per table in a request. Should we therefore have combined indexes on |
||
|
|
||
| CREATE INDEX IF NOT EXISTS trackscoveridx ON tracks(cover); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add this to one of the versioned files, too? If it's only used in the scanner (for now) we can probably get away adding it to the latest existing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That reminds me, I changed the INSERT to check tracks using coverid rather than cover, in case the user has updated an image without changing the file name. So I don't think this index is required any more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still might be using it around the In any case: if you wanted to keep it, please name it, as it's not an index on the cover ID. And for all index statements add a space or remove it everywhere between the table name and the index field 😉 .
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "idx" means index. I'll change it to "index"
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hah! Right! Keep the naming convention and upper/lower/camel casing consistent to help my aging and tired eyes and brain. |
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ignore MySQL - I'll remove it |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ignore MySQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to re-enable?