Question re the docs here <https://docs.lucee.org/...
# lucee
a
The narrative says to put a primary key on
cfid
,
name
, and another index on
expires
. But then the sample query you show doesn't actually do that:
Copy code
CREATE TABLE IF NOT EXISTS `cf_session_data` (
  `expires` varchar(64) NOT NULL,
  `cfid` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL,
  `data` text NOT NULL,
  UNIQUE KEY `ix_cf_session_data` (`cfid`,`name`,`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
No primary key, and just an unique index on all three of those columns. To compare, the narrative describes this sort of thing:
Copy code
CREATE TABLE `cf_session_data` (
  `expires` varchar(64) NOT NULL,
  `cfid` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL,
  `data` longtext NOT NULL,
  PRIMARY KEY (`cfid`,`name`),
  UNIQUE KEY `ix_cf_session_data` (`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Which should it be? And do you not think the guidance should match the code 😉
z
a
I've added those SQL create commands to the docs. I recall it was a pure export of the table created by the admin with heidiSQL. This is consistent with what the code in Lucee produces, as linked in the jire. Need to check how the data is selected just to see if the primary key/indexes are really relevant here, but I'd rather get rid of that paragraph of the docs. We should have seen a posted ticket by now if the actual table design would have caused performance issues.