Proposal for changing of pg_opclass

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Teodor Sigaev <teodor(at)stack(dot)net>
Subject: Proposal for changing of pg_opclass
Date: 2001-08-10 15:36:59
Message-ID: Pine.GSO.4.33.0108101726250.12908-100000@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

we present our plans to change of index AM tables following
Tom's idea (http://fts.postgresql.org/db/mw/msg.html?mid=1025731)

" ... pg_opclass should have, not just one row for each distinct opclass name,
but one row for each supported combination of index AM and opclass name."

This change would help to create indexes with keys and values
(to be indexed) of different types. Read some discussion in thread
http://fts.postgresql.org/db/mw/msg.html?mid=119796

We proposed to do our changes in 2 stages for smooth transition.

I) Changes of index AM tables (pg_opclass,pg_amop)
1. pg_opclass:
Add opcamid(oid) - index type identificator from pg_am
Add opckeytype(oid) - type of key,
if opckeytype == InvalidOid then opckeytype=opcdeftype
(opcname,opcamid) should be unique
Relation -> rd_att must be filled by using opckeytype, not
opcdeftype as now!!
Is't worth to have index on (opcname,opcamid) ?

2. pg_amop:
Add amopreqcheck(bool) - if TRUE, then results of check by index
required to test with original values.
At this stage we could determine index.islossy using amopreqcheck.
We could don't use index.islossy even at this stage but we need to know
how to determine pg_amop.reqcheck in create_indexscan_plan
(does it's right place to check ?)

After first stage completed we'll have everything we need

II) Removing unnecessary information - clearing system tables
1. remove pg_index.indislossy (see I.2) and indhaskeytype from
pg_index

2. remove pg_amop.amopid and pg_amproc.amid (see I.1)
Tom has sugessted (http://fts.postgresql.org/db/mw/msg.html?mid=1025860)
it might be remained because of performance reason. Tom, do you
have a decision ?

We hope to get a first version of patch in a week.

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-08-10 17:18:21 KQSO parameter
Previous Message Peter Eisentraut 2001-08-10 15:35:39 Re: Vague idea for allowing per-column locale