MySQL Forums
Forum List  »  Performance

Re: MySQL Performance or Just me? :(
Posted by: Ernest Semerda
Date: July 28, 2005 05:50PM

> ernest wrote:
> >
> 1) leave out the tableA.* and tableB.* columns.
> With the exception of tableB.fullname, this data
> is meaningless (see
> http://dev.mysql.com/doc/mysql/en/group-by-hidden-
> fields.html)

done.

>
> 2) Is the tableA.datestamp defined as datatype
> DATE? If yes, you need the literals '2005-01-06'
> and '2005-01-07'. If no, the date-comparisons will
> not work

yes, the SQL I pasted above had the incorrect date format.

>
> 3) Use WHERE tableA.datestamp BETWEEN '2005-01-06'
> AND '2005-01-07'

done

> Your query isn't using any indexes. You need an
> index on tableA.datestamp and on tableB.fullname:
>
> ALTER TABLE tableA ADD INDEX (datestamp);
> ALTER TABLE tableB ADD INDEX (fullname);
>

done. now the EXPLAIN statement produces:

table type possible_keys key key_len ref rows Extra
tableB ALL NULL NULL NULL NULL 117 Using temporary; Using filesort
tableA ALL datestamp NULL NULL NULL 434836 Using where

performance hasent changed :(

Options: ReplyQuote


Subject
Views
Written By
Posted
2590
July 27, 2005 11:53PM
1845
July 28, 2005 08:13AM
Re: MySQL Performance or Just me? :(
1710
July 28, 2005 05:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.