home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.informix
- Path: sparky!uunet!cs.utexas.edu!asuvax!ennews!anasaz!qip!devin
- From: devin@anasaz (Devin Wala)
- Subject: Two index query optimization problem
- Message-ID: <1992Dec12.000653.7004@anasaz>
- Organization: Anasazi, Inc. Phoenix, AZ, USA
- Distribution: usa
- Date: Sat, 12 Dec 1992 00:06:53 GMT
- Lines: 41
-
-
-
- I'm having some problems with Informix over optimizing my query.
- I have a table with > 500000 rows and I can't get Informix to
- use what I deem to be the "correct" index.
-
- There are two indexes on the table:
-
- index1: unique index on A, B;
- index2: unique index on C, D, A, B;
-
- The problem I'm having is that I can't run a query with A and B mentioned
- in the WHERE clause that will use index2. I suspect that the optimizer
- is looking at the query and saying; hey, I got A, I got B, I've got a unique
- index1 on both A and B. Look no further, I am set dudes and dudettes, and
- I am outta here! (optimizers talk like that you know).
-
- This would be fine if my queries were of the form:
-
- WHERE C=value AND D=value A=value AND B=value;
-
- However, one of my queries is of the form:
-
- WHERE C=value AND D=value A>value AND B=value;
-
- so it doesn't _really_ have a value for A. I do need to have both
- indexes for performance reasons. I don't think that setting optimization
- to low is an option in this case since it effects the whole database
- back end and not just the single query. We are running Online V 4.10.UF2,
- SQL V 4.00.UG2 on a Pyramid MI Server.
-
- Does anyone have any ideas, suggestions, or comments? Any help you
- can provide is greatly appreciated.
-
- Thanks much,
- Devin Wala
-
- --
- .\|/. Devin Wala | Arizona, The Land of Seven Seasons ..
- -(*)- Anasazi Inc. | Fall, Winter, Spring, Summer, Summer, Summer Summer
- `/|\' 870-3330(615) |
-