Re: UNION in JDBC - WAS Re: use of indexes

2005-07-27 Thread Gleb Paharenko
NION will allow you to use both composite >> > indexes at the same time because it is two queries. >> > >> > Ed >> > >> > -Original Message- >> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> > Sent: Friday, July 22, 2005

UNION in JDBC - WAS Re: use of indexes

2005-07-23 Thread Chris Faulkner
gt; > Ed > > > > -----Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Friday, July 22, 2005 6:04 AM > > To: Chris Faulkner > > Cc: mysql@lists.mysql.com > > Subject: Re: use of indexes > > > > The system c

RE: use of indexes

2005-07-22 Thread emierzwa
22, 2005 6:04 AM To: Chris Faulkner Cc: mysql@lists.mysql.com Subject: Re: use of indexes The system cannot used the index on field2 because it is the second half of the index in both cases, and it can only use indexes in order. It cannot use the separate indexes on field 1 and field 2 because the are

Re: use of indexes

2005-07-22 Thread Alec . Cawley
erms separately? If the field2 hit is is pretty selective, it does not really matter what the others do. Alec Chris Faulkner <[EMAIL PROTECTED]> 22/07/2005 12:46 Please respond to Chris Faulkner <[EMAIL PROTECTED]> To mysql@lists.mysql.com cc Subject Re: use of inde

Re: use of indexes

2005-07-22 Thread Chris Faulkner
Hi field2 is indexed. I have 2 indexes. One is on field1 and field2, the second indexes field3 and field2. You mean a separate index which only indexes field2 ? Ithought that the type of query I am doing is a good reason for doing composite indexes. Chris On 7/22/05, Eugene Kosov <[EMAIL PROT

Re: use of indexes

2005-07-22 Thread Eugene Kosov
Eugene Kosov wrote: Chris Faulkner wrote: HI I have a query like this select * from table where ( ( field1 = 'VALUE1' and field2 like 'VALUE2%' ) OR ( field3 = 'VALUE1' and field2 like 'VALUE2%' ) ) I have created two composite indexes - one on field1 + field2 and one on field3 + field2. Ex

Re: use of indexes

2005-07-22 Thread Eugene Kosov
Chris Faulkner wrote: HI I have a query like this select * from table where ( ( field1 = 'VALUE1' and field2 like 'VALUE2%' ) OR ( field3 = 'VALUE1' and field2 like 'VALUE2%' ) ) I have created two composite indexes - one on field1 + field2 and one on field3 + field2. Explain on the SQL