Re: General SQL question

2012-01-26 Thread Paul McNett
On 1/25/12 8:42 PM, MB Software Solutions, LLC wrote: > > UPDATE MyTable SET MyFactor = 1.23456 WHERE Field1 = 'VALUE' AND Field2 > = "VALUE2" > > So by using the IN clause, that nullifies any chance of optimizable tag > use What happens if you get rid of the IN clause, like: WHERE field1 = "

Re: General SQL question

2012-01-26 Thread MB Software Solutions, LLC
On 1/26/2012 11:21 AM, Stephen Russell wrote: > I don't live by mySQL like I do SQL Server so my experience is very limited. > > The base plan explanation that is a part of mySQL may not give all the > data that an add on by say Quest might do with say Toad for mySQL? > > Doing tests is the only wa

Re: General SQL question

2012-01-26 Thread Stephen Russell
On Thu, Jan 26, 2012 at 9:47 AM, MB Software Solutions, LLC wrote: > On 1/26/2012 9:28 AM, Stephen Russell wrote: > UPDATE MyTable SET MyFactor = 1.23456 WHERE Field1 = 'VALUE' AND Field2 IN ("VALUE2","VALUE3") The EXPLAIN says it won't use the combined index.  But for simpler

Re: General SQL question

2012-01-26 Thread MB Software Solutions, LLC
On 1/26/2012 9:28 AM, Stephen Russell wrote: >>> UPDATE MyTable SET MyFactor = 1.23456 WHERE Field1 = 'VALUE' AND Field2 >>> IN ("VALUE2","VALUE3") >>> >>> The EXPLAIN says it won't use the combined index. But for simpler >>> UPDATEs where it's just one value for Field2 and using an =, it says it

Re: General SQL question

2012-01-26 Thread Stephen Russell
On Wed, Jan 25, 2012 at 10:54 PM, MB Software Solutions, LLC wrote: > On 1/25/2012 11:42 PM, MB Software Solutions, LLC wrote: >> I'm dealing with very large datasets (millions of rows) and so my SQL >> needs to be "on" more than ever!  I'm using MySQL and I'm using EXPLAIN >>  to help me make su

Re: General SQL question

2012-01-25 Thread MB Software Solutions, LLC
On 1/25/2012 11:42 PM, MB Software Solutions, LLC wrote: > I'm dealing with very large datasets (millions of rows) and so my SQL > needs to be "on" more than ever! I'm using MySQL and I'm using EXPLAIN > to help me make sure my SQL is optimized. I've got several > fields, two of which are in my