What I have so far, pre-release, for purposes of discussion:

Schema
------

server (*servid, type, sole_server, all_db, sessions, sessmax, actsess,
	actsessmax, idlequant, quant)

session (*sessid, *servid, sessname, internal, dbname, dba, state, waitfor,
	mask, appuser, realuser, tty, groupid, roleid, appcode, curfac, query)

lock (llid, *lockid, rsb, gr, rq, state, phys)

locklist (*llid, tran_id, r_llb, r_cnt, wait, numlocks, logical_locks,
	maxlocks, status)

transaction (*tx_id, tran_id, database, process, dis_tran_id, session,
	first, last, cp, write, split, force, wait, status, realuser)

other (*bigname, littlevalue)

* primary key

Annotated
---------

server (servid=2202,	/* server ID */
	type=INGRES,	/* other possibilities: STAR, COMSVR, IINMSVR */
	sole_server=Y,	/* server is running sole_server */
	all_db=Y,	/* server will connect user to any DB */
	sessions=11,	/* 11 sessions in progress */
	sessmax=16,	/* server limited to 16 or fewer sessions */
	actsess=0,	/* 0 sessions in CS_COMPUTATBLE state (?) */
	actsessmax=16,	/* server limited to 16 in CS_COMPUTABLE state (?) */
	idlequant=0,	/* idle QUANTUMs since server startup */
	quant=0)	/* total QUANTUMs since server startup */

session (sessid=00550860,/* session ID */
	servid=2202,	/* session IDs unique within server ID */
	sessname=bill,	/* session name, not user name */
	internal=N,	/* is this an internal INGRES thread */
	dbname=demo,	/* database connected to (could be none) */
	dba=jpk,	/* owner of that database */
	state=CS_EVENT_WAIT,	/* about 7 other possibilities */
	waitfor=LOCK,	/* if state is CS_EVENT_WAIT, what waiting for */
	mask=CS_TIMEOUT_MASK,CS_INTERRUPT_MASK,	/* bitmask */
	appuser=bill,	/* apparent user (argument to -u flag)
	realuser=bill,	/* real user (OS userID of process) */
	tty=ttyp8,	/* only meaningful sometimes */
	groupid=null,	/* group ID */
	roleid=null,	/* role ID */
	appcode=00000000,/* who he? */
	curfac=QEF,	/* about 10 other possibilities */
	query=select term from posting89 where term like 'COMPUTER%')

lock (llid=001A0005,	/* lock list ID */
	lockid=009B0008,/* lock ID */
	rsb=00CD000C,	/* ID of resource lock was requested on */
	gr=S,		/* grant mode */
	rq=X,		/* requested mode */
	state=WT,	/* waiting or granted */
	phys=null)	/* is lock physical */

locklist (llid=001A0005,	/* lock list ID */
	tran_id=00002883BCBB0171,/* internal transaction ID */
	r_llb=001D0003,		/* related lock list ID */
	r_cnt=0,		/* count of r_llb? */
	wait=00CD000C,		/* lock list ID we're waiting for */
	numlocks=2,		/* how many locks in this lock list */
	logical_locks=1,	/* how many are logical locks */
	maxlocks=80,		/* will escalate if exceeded */
	status=WAIT)		/* lock list status */

transaction (tx_id=0006001B,	/* external transaction ID */
	tran_id=00002883BCBB0171,/* internal transaction ID */
	database=0001000C,	/* can translate to name */
	process=0001000A,	/* server process, OS ID */
	dis_tran_id=0000000000000000,	/* for STAR (?) */
	session=00000000,	/* this is wrong, see INGRES bug 38625 */
	first=0,		/* first block in logfile for this xact */
	last=0,			/* last block ... */
	cp=12,			/* next consistency point (?) */
	write=0,		/* total writes for this xact */
	split=0,		/* total writes split over logfile blcks ... */
	force=0,		/* total forced writes to logfile (?) ... */
	wait=0,			/* ? */
	status=INACTIVE,	/* bitmap, several other possibilities */
	realuser=bill)		/* INGRES name of transaction owner */

other (bigname=qsf_memleft,	/* ID of scalar */
	littlevalue=68624)	/* value of scalar */

Missing pieces
--------------

resource (resource_id, ... )	/* tables, pages, currently locked */

qep (sessid, parent, child)

query (sessid, node, structure, est_cpu, est_d, est_pages, est_tups,
	meas_cpu, meas_d, meas_pages, meas_tups ... )

Others.

Interesting queries
-------------------

/* list sessions */
SELECT
	sessname, dbname, dba
FROM
	session s, transaction t
WHERE
	s.sessid = t.session;
 
/* list sessions and who owns each one */
SELECT
	sessname, t.realuser
FROM
	session s, transaction t, locklist ll
WHERE
	t.tran_id = ll.tran_id
AND
	s.sessid = t.session;


/* list who's waiting */
SELECT
	distinct ll.llid, l.rsb, l.state, t.realuser
FROM
	server s, session ss, lock l, locklist ll, transaction t
WHERE
	ll.llid in (SELECT locklist.llid FROM lock, locklist WHERE
		lock.state = 'WT' and locklist.llid = lock.llid)
AND
	l.llid = ll.llid
AND
	t.tran_id = ll.tran_id;

