-----------------------------------------------------------------------------
-- SAKAI_SESSION
-----------------------------------------------------------------------------

CREATE TABLE SAKAI_SESSION
(
	SESSION_ID VARCHAR (36),
	SESSION_SERVER VARCHAR (255),
	SESSION_USER VARCHAR (99),
	SESSION_IP VARCHAR (128),
	SESSION_HOSTNAME VARCHAR (255),
	SESSION_USER_AGENT VARCHAR (255),
	SESSION_START DATETIME,
	SESSION_END DATETIME,
	SESSION_ACTIVE bit,
	CONSTRAINT SAKAI_SESSION_INDEX UNIQUE (SESSION_ID)
);

CREATE INDEX SAKAI_SESSION_SERVER_INDEX ON SAKAI_SESSION
(
	SESSION_SERVER
);

CREATE INDEX SAKAI_SESSION_START_END_IE ON SAKAI_SESSION
(
	SESSION_START,
	SESSION_END,
	SESSION_ID
);

create index SESSION_ACTIVE_IE on SAKAI_SESSION 
(
	SESSION_ACTIVE
);
