Hi,
I suggest that we should *not* enforce any referential integrity to Stats
related tables.

eg:
CREATE TABLE IF NOT EXISTS APM_APP_HITS (
UUID VARCHAR(500) NOT NULL,
APP_NAME VARCHAR(200) NOT NULL,
VERSION VARCHAR(50),
CONTEXT VARCHAR(256) NOT NULL,
USER_ID VARCHAR(50) NOT NULL,
TENANT_ID INTEGER,
HIT_TIME TIMESTAMP NOT NULL,
PRIMARY KEY (UUID, USER_ID, TENANT_ID, HIT_TIME),
FOREIGN KEY (UUID) REFERENCES APM_APP(UUID) ON UPDATE CASCADE ON DELETE
CASCADE
);

For an example this is a table we use to store stats related information
(user App access details). And we have added a foreign key constraint to
UUID (with cascade on delete)
If the original entry get deleted from the APM_APP, it will also delete the
references from this table as well. So we will loose some required
information.

So I suggest we should maintain the stat tables in a flat structure without
any reference to external tables, so need to remove the foreign key
constraints.
WDYT?

-- 
*Lahiru Cooray*
Software Engineer
WSO2, Inc.;http://wso2.com/
lean.enterprise.middleware

Mobile: +94 715 654154
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to