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

2005-07-27 Thread Gleb Paharenko
the query first in mysql and then in the JDBC client and I get the same so it is not caching. I've done a bit of searching but found nothing - any ideas ? Chris On 7/22/05, Chris Faulkner [EMAIL PROTECTED] wrote: That was exactly the problem. Thanks. MySQL can't use two indexes

UNION in JDBC - WAS Re: use of indexes

2005-07-24 Thread Chris Faulkner
: That was exactly the problem. Thanks. MySQL can't use two indexes on the same table at the same time. Thanks for the other suggestions but I'll use this workaround. Chris On 7/22/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I believe the conflict here is the OR. Try this... select * from table

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

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

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.

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

Re: use of indexes

2005-07-22 Thread Alec . Cawley
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 ORred together. If you rephrase your query SELECT * from table WHERE field2

RE: use of indexes

2005-07-22 Thread emierzwa
but it is on their list of to-do`s, this will be a cool feature. The UNION 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 6:04 AM To: Chris Faulkner Cc: mysql

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: Optimization and the use of indexes

2004-04-26 Thread Jeremy Zawodny
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 optimizer looks at the available 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: I

why mysql doesn't want to use my indexes???

2002-05-07 Thread pouet1234
Hi! I have a little pb with indexes. when I make an explain on my query I have strange results. my query looks like this select * from LIST l, WIN c where l.ID_LIST=c.ID_LIST and l.KEY = '421' and l.ACTIF='1'; table LIST : ID_LIST(primary key), KEY, ACTIF, ... table WIN ID_WIN(primary key),

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 NOT

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 fast.

RE: Proper use of indexes / keys

2001-12-16 Thread Roger Baklund
for that client or all clients for the timespan represented by the timestamp condition (24 hours). It can not use multiple indexes in the same statement (except for when using joins). The combined index would be able to select the wanted records directly, and it may also be used for any other query using

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)

Re: how force mysql to use certain indexes

2001-04-24 Thread Vivek Khera
PJM == Patrick J Militzer [EMAIL PROTECTED] writes: PJM I'm using mysql 3.22.27. How can I force mysql to use index's in PJM my select statement? You don't. SQL is a 4GL and you only describe what you want, and it is up to the language interpreter and optimizer to do it efficiently. --

Re: how force mysql to use certain indexes

2001-04-24 Thread Fred van Engen
Hi, On Tue, Apr 24, 2001 at 10:44:59AM -0400, Vivek Khera wrote: PJM == Patrick J Militzer [EMAIL PROTECTED] writes: PJM I'm using mysql 3.22.27. How can I force mysql to use index's in PJM my select statement? You don't. SQL is a 4GL and you only describe what you want, and it is up

how force mysql to use certain indexes

2001-04-23 Thread Patrick J. Militzer
Hi there, I'm using mysql 3.22.27. How can I force mysql to use index's in my select statement? When I use explain to see what the optimiser is doing I see that its using the wrong index. When I try to use the USE INDEX(KEY1,KEY) i get a syntax error. Any ideas Thanks, Pat Pat Militzer