Hi.
On Sun, Jul 22, 2001 at 03:38:10AM +0200, [EMAIL PROTECTED] wrote:
> Hi Benjamin,
>
> Just a quick gif picture of the explain of the other query I made..
> (It's quite late now and I will read your email tomorrow again..)
>
> > Could you post an EXPLAIN for it? I am curious to see it.
> >
> > > SELECT cpo.brandname,
> > > Sum((cpo.quantity)*(cpo.price)) AS omzet
> > > FROM perfect_customer_productorders AS cpo,
> > > perfect_customer_orders AS co
> > > WHERE co.id = cpo.orderid
> > > AND cpo.date >= DATE_FORMAT( DATE_SUB( NOW() , INTERVAL 30 DAY ) ,
>'%Y-%m-%d' )
> > > AND cpo.date <= DATE_FORMAT( DATE_SUB( NOW() , INTERVAL 0 DAY ) ,
>'%Y-%m-%d' )
> > > AND co.status != 2
> > > GROUP BY cpo.brandname
> > > ORDER BY omzet asc
>
> This is the explain:
>
> table type possible_keys key key_len ref rows Extra
> Edit Delete co ALL PRIMARY,id 2596 where used
> Edit Delete cpo ALL 4431 where used
That's bad. No index will be used. The only reason that comes to my
mind is that co.id and cpo.orderid are not of the same column type, or
if they are, not of the same length. Could you check this?
Bye,
Benjamin.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php