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