RE: Making Myself Crazy

2012-09-20 Thread Rick James
below.. > -Original Message- > From: Jan Steinman [mailto:j...@bytesmiths.com] > Sent: Wednesday, September 19, 2012 8:59 PM > To: mysql@lists.mysql.com > Subject: Re: Making Myself Crazy > > Thanks for your help, Rick! > > Interspersed are some questions and

Re: Making Myself Crazy

2012-09-19 Thread Jan Steinman
Thanks for your help, Rick! Interspersed are some questions and rationales for you to shoot down... :-) > From: Rick James > > s_product_sales_log has no PRIMARY KEY. All InnoDB tables 'should' have an > explicit PK. This table really has no identifying information. There could be two identi

RE: Making myself crazy...

2012-09-19 Thread Rick James
) mt ON mt.pcid = tt.pcid -- removed: WHERE mt.tot != 0 ) xx That would make mt have fewer rows, hence that unindexed JOIN could run faster. > -Original Message- > From: Jan Steinman [mailto:j...@bytesmiths.com] > Sent: Tuesday, September 18, 2012 9:26 PM > To: Rick

Re: Making myself crazy...

2012-09-18 Thread Jan Steinman
Thanks for your help, Rick. The solution that seems to be working was to have both the FROM and LEFT JOIN be grouped subqueries. I realize this is probably not the best way of doing things, but it seems fast enough at present. Here is the query, followed by the table definitions, resulting in t

RE: Making myself crazy...

2012-09-17 Thread Rick James
If the subquery-version is not too slow, live with it. If necessary, make your non-grouped SELECT a subquery and apply GROUP BY outside. Thus: SELECT ... FROM ( SELECT non-grouped... ) GROUP BY ... Could you provide that; we might be able to simplify it. Also provide SHOW CREATE TABLE for each