Skip to content

Performance optimizations #8

Description

@artur-stepien

I have few questions about performance.

Why do you use REPLACE INTO instead of INSERT ON DUPLICATE KEY UPDATE. When you're only creating new sessions this maybe makes sense. But most of the time you're gonna update sessions. For a small amount of sessions the difference is barely seen, but for a anything bigger this would stress the database for no reason with deleting the record before inserting when you only want to update the column/columns.

Second questions is why do you delete older sessions in open method instead of relying on php session garbage collect? Your solution forces a delete in every user interaction for every user. GC would reduce the amount queries and the more users application has the bigger the advantage of gc would be.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions