Gossamer Forum
Home : General : Databases and SQL :

performance flat file vs mysql

Quote Reply
performance flat file vs mysql
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
Quote Reply
Re: [delicia] performance flat file vs mysql In reply to
Hi,

Quote:
i assume that author_last is not indexed because the book doesn't mention indexing it. two questions (so far)

Indexes are setup in the database btw (easiest way to set them up is with phpMyAdmin)

Quote:
2. would this be faster if author_last were indexed? i guess you would add something like USE INDEX auth_last.

Most definitely. With indexes, the database can lookup records much quicker (especially with large databases)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!