IIrelation attributes

(Manfred Vorwerk) writes:
> Can someone tell me what the difference is between the following three
> attributes in the INGRES-SYSTEM-TABLE "IIRELATION"?
>
> 	- relpages,
> 	- relprim,
> 	- relmain.

In general, you're better off staying away from iirelation and sticking
with iitables.  The former is for INGRES internal use only; the latter
has a documented structure and is guaranteed not to change. 
Ingres-supplied front-end tools such as dclgen and copydb are written in
terms of the standard catalog interface for that very reason.

"relpages" is the estimated number of pages in the whole table or index.

"relprim" has to do with overflow pages.  It's used in the view
definition for iitables.  Here's a sample:

	overflow_pages = ((abs(r.relspec-11)*3)
		/((abs(r.relspec-11)*3)-1))*(int4(r.relpages-r.relprim))

You may be able to divine that the amount of overflow also has to do
with the structure of the table, which is coded in "relspec".

I couldn't find any mention of "relmain".  I searched all of the view
definitions in the system catalogs, in the "iiviews" table, in vain.

--Mark Jaeger
University of Chicago			phone: (312) 702-0328
Graduate School of Business		  fax: (312) 702-0233
1101 East 58th Street, W309		email: cs_mj@gsbvax.uchicago.edu 
Chicago, IL  60637-1511, USA		       (internet)



>In general, you're better off staying away from iirelation and sticking
>with iitables.  The former is for INGRES internal use only; the latter
>has a documented structure and is guaranteed not to change. 

One additional caveat.  We reserve the right to add new columns
to iitables.  We won't remove or rename columns, nor will we change datatype.
If you are reading System Catalogs, NEVER use a "select *".  Always name
all columns explicitly.  Then your application won't break when you 
upgrade to the next release.

System Catalogs are documented in an appendix of the 
INGRES/SQL Reference Manual.

-- 
Bill Coffin, at Ingres, An ASK Company, Alameda CA 
billc@ingres.com	510.748.3387
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William