Skip to content

Commit b9f84c8

Browse files
authored
Added indexes to sql commands used to create session tables
As per https://github.com/symfony/symfony/blob/4.4/UPGRADE-4.4.md#httpfoundation `PdoSessionHandler` now precalculates the expiry timestamp in the lifetime column
1 parent 9807a2f commit b9f84c8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

session/database.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ MariaDB/MySQL
393393
`sess_id` VARBINARY(128) NOT NULL PRIMARY KEY,
394394
`sess_data` BLOB NOT NULL,
395395
`sess_lifetime` INTEGER UNSIGNED NOT NULL,
396-
`sess_time` INTEGER UNSIGNED NOT NULL
396+
`sess_time` INTEGER UNSIGNED NOT NULL,
397+
INDEX `sessions_sess_lifetime_idx` (`sess_lifetime`)
397398
) COLLATE utf8mb4_bin, ENGINE = InnoDB;
398399
399400
.. note::
@@ -414,6 +415,7 @@ PostgreSQL
414415
sess_lifetime INTEGER NOT NULL,
415416
sess_time INTEGER NOT NULL
416417
);
418+
CREATE INDEX sessions_sess_time_idx ON sessions (sess_lifetime);
417419
418420
Microsoft SQL Server
419421
....................
@@ -424,7 +426,8 @@ Microsoft SQL Server
424426
sess_id VARCHAR(128) NOT NULL PRIMARY KEY,
425427
sess_data NVARCHAR(MAX) NOT NULL,
426428
sess_lifetime INTEGER NOT NULL,
427-
sess_time INTEGER NOT NULL
429+
sess_time INTEGER NOT NULL,
430+
INDEX sessions_sess_lifetime_idx (sess_lifetime)
428431
);
429432
430433
Store Sessions in a NoSQL Database (MongoDB)

0 commit comments

Comments
 (0)