On 3/29/07, Rich Shepard <[EMAIL PROTECTED]> wrote:
On Thu, 29 Mar 2007, Jonas Sandman wrote: > I guess I could split it into more tables, but would that really make > anything faster? It would make upgrades, changes, and searching faster. > The whole key is the filename, I query for files in specific filepaths, so > it doesn't matter if something is mis-spelled. Rather I encourage the > possibility that it can be. So you never query by artist, title, genre, or any other field in the table?
Yeah I do, but the path is always the most important part and the only thing that is ALWAYS queried.
So what should I use as a primary key then? The path? That's what you wrote that you use. I would make the title the primary key, unless you have the same title by different artists. In that case, I'd use a numeric key.
No, I use a full path (path+filename). Title doesn't even exists for all (and for none before the metadata has been scanned). What do I gain by using a numeric key instead of the path?
Since one file is one row in the database I rather liked the idea that I > didn't have to scatter around updating a lot of tables. I am using the > database instead of a large memory table like I used before. Then you might as well use a spreadsheet. With a relational database, multiple tables are related by foreign keys (which sqlite3 implements as triggers). If you have an interface other than the sqlite3 command line editor then you enter information in the appropriate data entry widgets and use your middleware code to store/retrieve from appropriate tables.
I just used a binary file which I read up into a memory table before but figured it was better to use a database to gain some query functionality for free. I just didn't see the need for it in this case to split it into several tables (though I know that's how it supposed to be done usually), unless there is a gain of splitting the data for performance. I always query all the data, and I always run LIKE on title, artist, album etc. to determine if a keyword match what's in there. --
Richard B. Shepard, Ph.D. | The Environmental Permitting Applied Ecosystem Services, Inc. | Accelerator(TM) <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

