Re: [HACKERS] VACUUM ANALYZE Problem - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] VACUUM ANALYZE Problem
Date
Msg-id 199802050427.XAA18349@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] VACUUM ANALYZE Problem  ("Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>)
List pgsql-hackers
OK, I have looked at this, but can't figure out how to fix the many
initializations of ScanKeyData.  Can someone who understands this please
submit a patch for all these initializations so we can stop these vacuum
analyze reports?

Vadim has found the problem, but we need someone to properly fix it.

> James Hughes wrote:
> >
> > After poking arround some more, I found that the "vacuum analyze" is
> > causing problems with the "<" and ">" operators. The "> 0" in the SELECT
> > for "/d <table>" and "/dS" commands in psql cause the error.
> >
> > I verified that any simple query using the "<" or ">" operators fail
> > with the same message...
> >
> >         ERROR:  fmgr_info: function 0: cache lookup failed
> >
> >                         ...after using the "vacuum analyse" command.
> > But, only after vacuuming any relation that was created and populated by
> > me. Vacumming system catalogs poses no problems.
>
> Well, I found that this problem was caused by selfuncs.c:gethilokey():
>
>     static ScanKeyData key[3] = {
>         {0, Anum_pg_statistic_starelid, F_OIDEQ},
>         {0, Anum_pg_statistic_staattnum, F_INT2EQ},
>         {0, Anum_pg_statistic_staop, F_OIDEQ}
>
> : skankeys are hardcoded without call to ScanKeyEntryInitialize() =>
> without initialization of sk_func.fn_oid required, I assume, by
> new PL support code. Patch for this place follows...
> One should check all places where ScanKeyData is used.
> Jan, could you do this ?
>
> (Oh, hell! I got this ERROR while testing subselect and spent so many time
> to fix this problem...)
>
> Vadim
> --------------A99EE0A2D8F4D665C5BF3957
> Content-Type: application/octet-stream; name="FFF"
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename="FFF"
>
> KioqIHNlbGZ1bmNzLmN+CU1vbiBGZWIgIDIgMTM6NTU6NDcgMTk5OAotLS0gc2VsZnVuY3Mu
> YwlUdWUgRmViICAzIDE3OjM2OjAxIDE5OTgKKioqKioqKioqKioqKioqCioqKiAzMzcsMzQ1
> ICoqKioKICAJcmVnaXN0ZXIgUmVsYXRpb24gcmRlc2M7CiAgCXJlZ2lzdGVyIEhlYXBTY2Fu
> RGVzYyBzZGVzYzsKICAJc3RhdGljIFNjYW5LZXlEYXRhIGtleVszXSA9IHsKISAJCXswLCBB
> bnVtX3BnX3N0YXRpc3RpY19zdGFyZWxpZCwgRl9PSURFUX0sCiEgCQl7MCwgQW51bV9wZ19z
> dGF0aXN0aWNfc3RhYXR0bnVtLCBGX0lOVDJFUX0sCiEgCQl7MCwgQW51bV9wZ19zdGF0aXN0
> aWNfc3Rhb3AsIEZfT0lERVF9CiAgCX07CiAgCWJvb2wJCWlzbnVsbDsKICAJSGVhcFR1cGxl
> CXR1cGxlOwotLS0gMzM3LDM0NSAtLS0tCiAgCXJlZ2lzdGVyIFJlbGF0aW9uIHJkZXNjOwog
> IAlyZWdpc3RlciBIZWFwU2NhbkRlc2Mgc2Rlc2M7CiAgCXN0YXRpYyBTY2FuS2V5RGF0YSBr
> ZXlbM10gPSB7CiEgCQl7MCwgQW51bV9wZ19zdGF0aXN0aWNfc3RhcmVsaWQsIEZfT0lERVEs
> IHswLCAwLCBGX09JREVRfX0sCiEgCQl7MCwgQW51bV9wZ19zdGF0aXN0aWNfc3RhYXR0bnVt
> LCBGX0lOVDJFUSwgezAsIDAsIEZfSU5UMkVRfX0sCiEgCQl7MCwgQW51bV9wZ19zdGF0aXN0
> aWNfc3Rhb3AsIEZfT0lERVEsIHswLCAwLCBGX09JREVRfX0KICAJfTsKICAJYm9vbAkJaXNu
> dWxsOwogIAlIZWFwVHVwbGUJdHVwbGU7Cg==
> --------------A99EE0A2D8F4D665C5BF3957--
>
>


--
Bruce Momjian
maillist@candle.pha.pa.us

pgsql-hackers by date:

Previous
From: Tom I Helbekkmo
Date:
Subject: Re: [HACKERS] configure on linux
Next
From: "Vadim B. Mikheev"
Date:
Subject: Re: [HACKERS] VACUUM ANALYZE Problem