--- mqtt/etc/mqtt_pub.sql 2012/02/01 14:53:13 1.2.2.1 +++ mqtt/etc/mqtt_pub.sql 2012/05/08 13:40:07 1.2.2.2 @@ -12,6 +12,7 @@ WillRetain tinyint, Stamp timestamp); CREATE TABLE IF NOT EXISTS Topics ( id integer not null primary key, +ConnID varchar(23) not null, MsgID smallint unsigned not null, QoS char not null, Retain char not null, @@ -23,6 +24,7 @@ PubHost varchar(64) not null, Stamp timestamp); CREATE TABLE IF NOT EXISTS Subscribes ( id integer not null primary key, +ConnID varchar(23) not null, MsgID smallint unsigned not null, QoS char not null, Topic varchar(255) not null, @@ -37,11 +39,13 @@ CREATE INDEX IF NOT EXISTS topics_PubHost on Topics (P CREATE INDEX IF NOT EXISTS topics_PubUser on Topics (PubUser); CREATE INDEX IF NOT EXISTS topics_MsgID on Topics (MsgID); CREATE INDEX IF NOT EXISTS topics_Topic on Topics (Topic); +CREATE INDEX IF NOT EXISTS topics_ConnID on Topics (ConnID); CREATE INDEX IF NOT EXISTS subscribes_PubDate on Subscribes (PubDate); CREATE INDEX IF NOT EXISTS subscribes_PubHost on Subscribes (PubHost); CREATE INDEX IF NOT EXISTS subscribes_PubUser on Subscribes (PubUser); CREATE INDEX IF NOT EXISTS subscribes_MsgID on Subscribes (MsgID); CREATE INDEX IF NOT EXISTS subscribes_Topic on Subscribes (Topic); +CREATE INDEX IF NOT EXISTS subscribes_ConnID on Subscribes (ConnID); CREATE TRIGGER IF NOT EXISTS Online_update_t AFTER UPDATE ON Online BEGIN UPDATE Online SET Stamp = strftime('%s', 'now') WHERE ConnID = old.ConnID;