From 1b19c2f40468c619b76160c4b30a70a1fa3d8fca Mon Sep 17 00:00:00 2001 From: Vikas Patel Date: Wed, 16 Dec 2020 19:07:25 +0530 Subject: [PATCH] index hint on session tables (#1036) * index hint on session tables expires column should be indexed so that purging do get timed out. * typo https://docs.lucee.org/guides/Various/FAQs/technical-FAQs/database-session.html --- .../15.FAQs/01.technical-FAQs/02.database-session/page.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/04.guides/13.Various/15.FAQs/01.technical-FAQs/02.database-session/page.md b/docs/04.guides/13.Various/15.FAQs/01.technical-FAQs/02.database-session/page.md index 9fbcce705..c31730891 100644 --- a/docs/04.guides/13.Various/15.FAQs/01.technical-FAQs/02.database-session/page.md +++ b/docs/04.guides/13.Various/15.FAQs/01.technical-FAQs/02.database-session/page.md @@ -44,6 +44,8 @@ That's it! * Primary key existence (DESCRIBE cf_session_data). If primary key doesn't exist add composite primary key (cfid, name). You can run ALTER TABLE cf_session_data ADD PRIMARY KEY(cfid,name) for that. This helps you avoid performance problems as your cf_session_data table will grow. +* index present on expires column. You'll need it if you have a large amount of traffic because purging will check expired records and the index will help to do it faster. + * Type of "data" column should be longtext, not text. Run ALTER TABLE cf_session_data MODIFY data longtext to change. (Fixed in versions 4.2.0, 4.1.2.006). This is a must have if you store big data (arrays, structs) in session. Otherwise you'll get the data truncation error For reference only and in case information about structure and indexes of the mysql tables is needed, find a MySql structure export of the cf_session_data and cf_client_data below: