--- Emmett Bishop <[EMAIL PROTECTED]> wrote:
> David,
> 
> It sounds like you need some indexes on your table.
> Do
> this... put the word EXPLAIN in front of the select
> statement to you use to get your data. For more
> info,
> check out this link
> http://dev.mysql.com/doc/mysql/en/EXPLAIN.html on
> the
> MySQL site. Email me the output of the EXPLAIN
> statement and I'll take a look. Take a look at the
> above page and you should be able to get a pretty
> clear idea of how well your query is optimized. It's
> a
> good idea to run EXPLAIN on all but the simplest of
> queries to see what MySQL is going to do with them.
> 
> Yes, I would have designed the db with more tables.
> Generally, tables should represent distinct "things"
> or the relationships between "things". Countries,
> states, or counties to use your example. But each
> table should represent one kind thing.
> 
> Do a google search on "Normalize Database" and
> you'll
> find some good information on approaches to database
> design. They might give some of the theoretical
> background that you're looking for.

Aha! I added "EXPLAIN," like this...

$res = mysql_query ("EXPLAIN SELECT Name, Residents,
Pop, Capital FROM basics
where Capital like '%VOLCAN%'") or die
(mysql_error());

but none of my data displays at all.

However, I did indeed strip out all my keys so I could
get my tables published online. I probably only needed
to get rid of the foreign keys, but I didn't want to
take any chances.

Anyway, I added a primary key, but the table still
loads slowly. However, I'm guessing that it isn't
enough to have a key on a table - that key also has to
be cited in your query/select statements. Is that
right?

Thanks.


        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to