Skip to content

Added indexes to sql commands used to create session tables #15354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2021

Conversation

JohnstonCode
Copy link
Contributor

@JohnstonCode JohnstonCode commented May 18, 2021

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, so the index will speed up garbage collection

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
@carsonbot carsonbot added this to the 4.4 milestone May 18, 2021
@javiereguiluz
Copy link
Member

javiereguiluz commented May 18, 2021

Christopher, thanks for this proposal!

I think it's a good idea because, in a real app, this table will be accessed a lot. However, looking at PdoSession class, all SELECT and UPDATE queries use the id column as the only WHERE clause. Should we create the index on that column instead? I don't know, so I'm just asking.

Sorry ... I misread the description of your PR, so everything I said is wrong. Let's forget it 😊

Before merging I'll wait for others to review this. Thanks!

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@javiereguiluz
Copy link
Member

Thank you Christopher.

@javiereguiluz javiereguiluz merged commit e02b772 into symfony:4.4 May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants