home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / informix / 2676 < prev    next >
Encoding:
Text File  |  1992-12-12  |  1.8 KB  |  52 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!cs.utexas.edu!asuvax!ennews!anasaz!qip!devin
  3. From: devin@anasaz (Devin Wala)
  4. Subject: Two index query optimization problem
  5. Message-ID: <1992Dec12.000653.7004@anasaz>
  6. Organization: Anasazi, Inc. Phoenix, AZ, USA
  7. Distribution: usa
  8. Date: Sat, 12 Dec 1992 00:06:53 GMT
  9. Lines: 41
  10.  
  11.  
  12.  
  13. I'm having some problems with Informix over optimizing my query. 
  14. I have a table with > 500000 rows and I can't get Informix to
  15. use what I deem to be the "correct" index.
  16.  
  17. There are two indexes on the table:
  18.  
  19.    index1: unique index on A, B;
  20.    index2: unique index on C, D, A, B;
  21.  
  22. The problem I'm having is that I can't run a query with A and B mentioned
  23. in the WHERE clause that will use index2.  I suspect that the optimizer
  24. is looking at the query and saying; hey, I got A, I got B, I've got a unique
  25. index1 on both A and B.  Look no further, I am set dudes and dudettes, and 
  26. I am outta here! (optimizers talk like that you know).
  27.  
  28. This would be fine if my queries were of the form:  
  29.  
  30.    WHERE C=value AND D=value A=value AND B=value; 
  31.    
  32. However, one of my queries is of the form:
  33.  
  34.    WHERE C=value AND D=value A>value AND B=value; 
  35.  
  36. so it doesn't _really_ have a value for A.  I do need to have both
  37. indexes for performance reasons.  I don't think that setting optimization
  38. to low is an option in this case since it effects the whole database
  39. back end and not just the single query.  We are running Online V 4.10.UF2, 
  40. SQL V 4.00.UG2 on a Pyramid MI Server.
  41.  
  42. Does anyone have any ideas, suggestions, or comments?  Any help you
  43. can provide is greatly appreciated.
  44.  
  45. Thanks much,
  46.   Devin Wala
  47.  
  48. -- 
  49. .\|/. Devin Wala    | Arizona, The Land of Seven Seasons ..
  50. -(*)- Anasazi Inc.  | Fall, Winter, Spring, Summer, Summer, Summer Summer
  51. `/|\' 870-3330(615) | 
  52.