Hello @balaji.ramaswamy,
the tables alf_child_assoc, alf_node and alf_qname contain “id” columns.
DDLs of the four involved tables:
alf_child_assoc
CREATE TABLE public.alf_child_assoc (
id int8 NOT NULL,
"version" int8 NOT NULL,
parent_node_id int8 NOT NULL,
type_qname_id int8 NOT NULL,
child_node_name_crc int8 NOT NULL,
child_node_name varchar(50) NOT NULL,
child_node_id int8 NOT NULL,
qname_ns_id int8 NOT NULL,
qname_localname varchar(255) NOT NULL,
qname_crc int8 NOT NULL,
is_primary bool NULL,
assoc_index int4 NULL,
CONSTRAINT alf_child_assoc_pkey PRIMARY KEY (id)
);
CREATE INDEX fk_alf_cass_cnode ON public.alf_child_assoc (child_node_id);
CREATE INDEX fk_alf_cass_qnns ON public.alf_child_assoc (qname_ns_id);
CREATE INDEX fk_alf_cass_tqn ON public.alf_child_assoc (type_qname_id);
CREATE INDEX idx_alf_cass_pnode ON public.alf_child_assoc (parent_node_id,assoc_index,id);
CREATE INDEX idx_alf_cass_pri ON public.alf_child_assoc (parent_node_id,is_primary,child_node_id);
CREATE INDEX idx_alf_cass_qncrc ON public.alf_child_assoc (qname_crc,type_qname_id,parent_node_id);
CREATE UNIQUE INDEX parent_node_id ON public.alf_child_assoc (parent_node_id,type_qname_id,child_node_name_crc,child_node_name);
-- public.alf_child_assoc foreign keys
ALTER TABLE public.alf_child_assoc ADD CONSTRAINT fk_alf_cass_cnode FOREIGN KEY (child_node_id) REFERENCES public.alf_node(id);
ALTER TABLE public.alf_child_assoc ADD CONSTRAINT fk_alf_cass_pnode FOREIGN KEY (parent_node_id) REFERENCES public.alf_node(id);
ALTER TABLE public.alf_child_assoc ADD CONSTRAINT fk_alf_cass_qnns FOREIGN KEY (qname_ns_id) REFERENCES public.alf_namespace(id);
ALTER TABLE public.alf_child_assoc ADD CONSTRAINT fk_alf_cass_tqn FOREIGN KEY (type_qname_id) REFERENCES public.alf_qname(id);
alf_node
CREATE TABLE public.alf_node (
id int8 NOT NULL,
"version" int8 NOT NULL,
store_id int8 NOT NULL,
uuid varchar(36) NOT NULL,
transaction_id int8 NOT NULL,
type_qname_id int8 NOT NULL,
locale_id int8 NOT NULL,
acl_id int8 NULL,
audit_creator varchar(255) NULL,
audit_created varchar(30) NULL,
audit_modifier varchar(255) NULL,
audit_modified varchar(30) NULL,
audit_accessed varchar(30) NULL,
CONSTRAINT alf_node_pkey PRIMARY KEY (id)
);
CREATE INDEX fk_alf_node_acl ON public.alf_node (acl_id);
CREATE INDEX fk_alf_node_loc ON public.alf_node (locale_id);
CREATE INDEX fk_alf_node_store ON public.alf_node (store_id);
CREATE INDEX idx_alf_node_cor ON public.alf_node (audit_creator,store_id,type_qname_id,id);
CREATE INDEX idx_alf_node_crd ON public.alf_node (audit_created,store_id,type_qname_id,id);
CREATE INDEX idx_alf_node_mdq ON public.alf_node (store_id,type_qname_id,id);
CREATE INDEX idx_alf_node_mod ON public.alf_node (audit_modified,store_id,type_qname_id,id);
CREATE INDEX idx_alf_node_mor ON public.alf_node (audit_modifier,store_id,type_qname_id,id);
CREATE INDEX idx_alf_node_tqn ON public.alf_node (type_qname_id,store_id,id);
CREATE INDEX idx_alf_node_txn ON public.alf_node (transaction_id);
CREATE INDEX idx_alf_node_txn_type ON public.alf_node (transaction_id,type_qname_id);
CREATE INDEX idx_alf_node_ver ON public.alf_node ("version");
CREATE UNIQUE INDEX store_id ON public.alf_node (store_id,uuid);
-- public.alf_node foreign keys
ALTER TABLE public.alf_node ADD CONSTRAINT fk_alf_node_acl FOREIGN KEY (acl_id) REFERENCES public.alf_access_control_list(id);
ALTER TABLE public.alf_node ADD CONSTRAINT fk_alf_node_loc FOREIGN KEY (locale_id) REFERENCES public.alf_locale(id);
ALTER TABLE public.alf_node ADD CONSTRAINT fk_alf_node_store FOREIGN KEY (store_id) REFERENCES public.alf_store(id);
ALTER TABLE public.alf_node ADD CONSTRAINT fk_alf_node_tqn FOREIGN KEY (type_qname_id) REFERENCES public.alf_qname(id);
ALTER TABLE public.alf_node ADD CONSTRAINT fk_alf_node_txn FOREIGN KEY (transaction_id) REFERENCES public.alf_transaction(id);
alf_node_properties
CREATE TABLE public.alf_node_properties (
node_id int8 NOT NULL,
actual_type_n int4 NOT NULL,
persisted_type_n int4 NOT NULL,
boolean_value bool NULL,
long_value int8 NULL,
float_value float4 NULL,
double_value float8 NULL,
string_value varchar(1024) NULL,
serializable_value bytea NULL,
qname_id int8 NOT NULL,
list_index int4 NOT NULL,
locale_id int8 NOT NULL,
CONSTRAINT alf_node_properties_pkey PRIMARY KEY (node_id,qname_id,list_index,locale_id)
);
CREATE INDEX fk_alf_nprop_loc ON public.alf_node_properties (locale_id);
CREATE INDEX fk_alf_nprop_n ON public.alf_node_properties (node_id);
CREATE INDEX fk_alf_nprop_qn ON public.alf_node_properties (qname_id);
CREATE INDEX idx_alf_nprop_b ON public.alf_node_properties (qname_id,boolean_value,node_id);
CREATE INDEX idx_alf_nprop_d ON public.alf_node_properties (qname_id,double_value,node_id);
CREATE INDEX idx_alf_nprop_f ON public.alf_node_properties (qname_id,float_value,node_id);
CREATE INDEX idx_alf_nprop_l ON public.alf_node_properties (qname_id,long_value,node_id);
CREATE INDEX idx_alf_nprop_s ON public.alf_node_properties (qname_id,string_value,node_id);
-- public.alf_node_properties foreign keys
ALTER TABLE public.alf_node_properties ADD CONSTRAINT fk_alf_nprop_loc FOREIGN KEY (locale_id) REFERENCES public.alf_locale(id);
ALTER TABLE public.alf_node_properties ADD CONSTRAINT fk_alf_nprop_n FOREIGN KEY (node_id) REFERENCES public.alf_node(id);
ALTER TABLE public.alf_node_properties ADD CONSTRAINT fk_alf_nprop_qn FOREIGN KEY (qname_id) REFERENCES public.alf_qname(id);
alf_qname
CREATE TABLE public.alf_qname (
id int8 NOT NULL,
"version" int8 NOT NULL,
ns_id int8 NOT NULL,
local_name varchar(200) NOT NULL,
CONSTRAINT alf_qname_pkey PRIMARY KEY (id)
);
CREATE UNIQUE INDEX ns_id ON public.alf_qname (ns_id,local_name);
-- public.alf_qname foreign keys
ALTER TABLE public.alf_qname ADD CONSTRAINT fk_alf_qname_ns FOREIGN KEY (ns_id) REFERENCES public.alf_namespace(id);
best
Muffex