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

use of indexes

2005-07-22 Thread Chris Faulkner
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 indicates that the indexes

RE: Optimization and the use of indexes

2004-04-26 Thread Boyd E. Hemphill
-2287 M: (713) 252-4688 -Original Message- From: Jeremy Zawodny [mailto:[EMAIL PROTECTED] Sent: Monday, April 26, 2004 4:23 PM To: Boyd E. Hemphill Cc: [EMAIL PROTECTED] Subject: Re: Optimization and the use of indexes On Mon, Apr 26, 2004 at 05:17:45PM -0500, Boyd E. Hemphill wrote: >

Re: Optimization and the use of indexes

2004-04-26 Thread Jeremy Zawodny
but that's best thought of as multiple queries anyway. > Are there any more details regarding the use of indexes I can find > in the documentation? Specifically how the optimizer picks which > index to use? I read through 7.2.4 and several other sections but > no luck. The

Optimization and the use of indexes

2004-04-26 Thread Boyd E. Hemphill
I thought I heard at the conference that the optimizer only uses a one index per table in a query regardless of the number of indexes on the table. Is this true? Are there any more details regarding the use of indexes I can find in the documentation? Specifically how the optimizer picks which

RE: Proper use of indexes / keys

2001-12-16 Thread Roger Baklund
* Sebastian Bergmann > Roger Baklund wrote: > > You can almost always improve the performance of queries by adding an > > index. The trick is to add the right index... :) If you for instance > > often did a "SELECT * FROM pot_accesslog WHERE client_id=$id AND > > timestamp > NOW() - INTERVAL 24 HO

Re: Proper use of indexes / keys

2001-12-16 Thread Sebastian Bergmann
Roger Baklund wrote: > However, if the behaviour with no restrictions on duplicates is > correct, you may be better of without a primary key in this case. Okay, that's what I need here. > Also, the second create statement defines indexes on all fields, making > almost any query reasonably fas

RE: Proper use of indexes / keys

2001-12-16 Thread Roger Baklund
* Sebastian Bergmann > I am currently trying to optimize the indexes / keys for the MySQL > schema of phpOpenTracker. I don't know phpOpenTracker, but I have a few comments. > I'm wondering if multiple keys, like > > CREATE TABLE pot_accesslog ( > accesslog_id int(10) unsigned NO

Proper use of indexes / keys

2001-12-15 Thread Sebastian Bergmann
I am currently trying to optimize the indexes / keys for the MySQL schema of phpOpenTracker. I'm wondering if multiple keys, like CREATE TABLE pot_accesslog ( accesslog_id int(10) unsigned NOT NULL, client_idint(10) unsigned NOT NULL, document_id int(11)