i'm reading first book about mysql in hopes of learning how to improve performance in my db if i switch from dbman to dbman sql. an example in the sql book follows:
SELECT books.recid, title,year,
CONCAT(author_first, ' ', author_last) AS author
FROM books, authors
WHERE author_last = 'Vernon'
AND author_id = authors.recid
i assume that author_last is not indexed because the book doesn't mention indexing it. two questions (so far)
1. would this scenario be faster than searching a dbman flatfile author file for lastname = Vernon and then using the ID for that record to find matching records in the book db?
2. would this be faster if author_last were indexed? i guess you would add something like USE INDEX auth_last.
tks
SELECT books.recid, title,year,
CONCAT(author_first, ' ', author_last) AS author
FROM books, authors
WHERE author_last = 'Vernon'
AND author_id = authors.recid
i assume that author_last is not indexed because the book doesn't mention indexing it. two questions (so far)
1. would this scenario be faster than searching a dbman flatfile author file for lastname = Vernon and then using the ID for that record to find matching records in the book db?
2. would this be faster if author_last were indexed? i guess you would add something like USE INDEX auth_last.
tks