home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / ingres / 2144 < prev    next >
Encoding:
Text File  |  1992-12-29  |  2.8 KB  |  62 lines

  1. Newsgroups: comp.databases.ingres
  2. Path: sparky!uunet!tpghq!sfc
  3. From: sfc@tpghq.com (Steve Caswell)
  4. Subject: Re: Optimizer question
  5. Message-ID: <1992Dec29.143857.12665@tpghq.com>
  6. Organization: Palmer & Associates, Inc., Norcross, GA
  7. References: <Dec28.232159.59717@yuma.ACNS.ColoState.EDU>
  8. Date: Tue, 29 Dec 1992 14:38:57 GMT
  9. Lines: 51
  10.  
  11. In article <Dec28.232159.59717@yuma.ACNS.ColoState.EDU> daveb@NREL.ColoState.EDU (Dave Bigelow 491-5574) writes:
  12. >Using INGRES SunOS Version 6.4/02 (su4.u42/00) on a 670MP I get
  13. >the following message when I try to do a count by on a data field
  14. >(field_name). This also happens in Report_Writer when a conditional
  15. >on the field is specified.
  16. >
  17. >   'the histogram for [field_name] is not monotonically increasing.'
  18. >
  19. >In poking around I discovered that the table was re-optimized but
  20. >the second time without the inclusion of the offending field.  My
  21. >question is does the optimizer clear stale statistics each time it
  22. >is invoked or do I have to do another modify to clear the
  23. >statistics? Is this the likely cause of the problem?
  24. >
  25. >Thanks for your reply.
  26. >
  27. >-- 
  28. >Dave Bigelow                        
  29. >Natural Resource Ecology Laboratory  internet:  daveb@panicum.nrel.colostate.edu
  30. >Colorado State University            telephone: 303-491-5574      
  31. >Fort Collins, CO 80523               FAX:       303-491-1965
  32.  
  33. There is a bug in 6.4/02 that causes the symptom you mentioned.  The problem
  34. is most likely to occur when a date column that is used in a comparison contains
  35. some enpty strings rather than non-empty actual dates.  The problem stems from
  36. a bug in the optimizedb utility which produces overlapping histograms if this
  37. data condition exists.
  38.  
  39. To avoid the problem, remove the optimizer staistics from certain date columns
  40. that are involved in queries that file with the "not monotonically increasing"
  41. error.  The involved date columns probably appear in comparison (i.e., the
  42. where clause) in the queries that fail.
  43.  
  44. Statistics can be removed from offending columsn selectively.  For example,
  45. to remove statistics from the 'columnname' column in the table 'tablename',
  46. in the database 'dbname', do the following:
  47.  
  48.    statdump -zdl dbname -rtablename -acolumnname
  49.  
  50. To answer your original questions, INGRES only clears stale statistics when
  51. you specify a particular column.  In other words, when optimizedb was run the
  52. second time, with the offending column ommitted, optimizedb only performed
  53. optimization on columns you specified.  It left stats on the other columns
  54. alone (I'm assuming you ran optimizedb with some kind of flag telling it which
  55. columns to optimize).
  56.  
  57. -- 
  58.  
  59. Steve Caswell           |   (404) 448-7727    |  "The opinions expressed are my
  60. Principal Consultant    |   sfc@tpghq.com     |   own.  They may not be perfect,
  61. The Palmer Group        |   uunet!tpghq!sfc   |   but they're all I've got."
  62.