...
Code Block |
---|
Postgresql: Note that the trigger (see examples below) does not need to fill in the timestamp as it defaults in the table DDL. The indexes are suggested if you are putting more than a 1000 or so rows in here per day. Most sites run the incremental_loader very often, so the query to find 0 zero rows should complete very quickly. CREATE TABLE IF NOT EXISTS myincrementaltable( id SERIAL NOT NULL UNIQUE, subject_id VARCHAR( 256 ), subject_identifier VARCHAR( 256 ), subject_id_or_identifier VARCHAR( 256 ), subject_source_id VARCHAR( 256 ), loader_group_name VARCHAR( 1024 ) NOT NULL, timestamp BIGINT NOT NULL DEFAULT( EXTRACT(EPOCH FROM CLOCK_TIMESTAMP())*1000::BIGINT ), completed_timestamp BIGINT, PRIMARY KEY( id ) ); CREATE INDEX IF NOT EXISTS myincrementaltable_completed_timestamp_index ON myincrementaltable( completed_timestamp ); CREATE INDEX IF NOT EXISTS myincrementaltable_loader_group_name_index ON myincrementaltable( loader_group_name ); GRANT ALL ON myincrementaltable TO grouperROLE; GRANT ALL ON myincrementaltable_id_seq TO grouperROLE; |
...