Skip to content

Improve performance of #__session with a large session count - New Index#22668

Closed
tonypartridge wants to merge 2 commits intojoomla:stagingfrom
tonypartridge:staging-session-index
Closed

Improve performance of #__session with a large session count - New Index#22668
tonypartridge wants to merge 2 commits intojoomla:stagingfrom
tonypartridge:staging-session-index

Conversation

@tonypartridge
Copy link
Copy Markdown
Contributor

Pull Request for Issue #22632 .

Summary of Changes

Adds a new index 'client_guest' against client and guest columns

Testing Instructions

Have a large sessions table i.e. 14,000 rows. You can use a script I created to add these;
https://gist.github.com/tonypartridge/43c3d6f2f47d566fa8f7a28c9c4089a8

Expected result

as it is now but faster

Actual result

as it is now

Documentation Changes Required

The index will improve session query performance on MySQL databases. Omn average I am seeing a 30ms session query brought down to around 8ms saving 22ms.

Note, testing should be done on non-cached queries.

@PhilETaylor

This comment was marked as abuse.

KEY `userid` (`userid`),
KEY `time` (`time`)
KEY `time` (`time`),
KEY `client_guest` (`client_id`, `guest`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove ;

@alikon
Copy link
Copy Markdown
Contributor

alikon commented Oct 16, 2018

don't forget postgresql , mssql

@tonypartridge
Copy link
Copy Markdown
Contributor Author

don't forget postgresql , mssql

@alikon I don't have a postgresql or mssql, or azuresql instance to test against, it's not 100% needed for those databases. This is just a PR against the mysql one to further improve performance.

Feel free to submit a PR for those too as well.

@mbabker
Copy link
Copy Markdown
Contributor

mbabker commented Oct 17, 2018

The database schema should be consistent across platforms, including indexes. So if we're changing MySQL, the others should be changed at the same time.

@tonypartridge
Copy link
Copy Markdown
Contributor Author

tonypartridge commented Oct 17, 2018 via email

@brianteeman brianteeman changed the title Improve performance off #__session with a large session count - New Index Improve performance of #__session with a large session count - New Index Oct 19, 2018
@alikon
Copy link
Copy Markdown
Contributor

alikon commented Jan 23, 2019

@tonypartridge sorry, but unable to sumbit a pr to your branch
see #23650

KEY `userid` (`userid`),
KEY `time` (`time`)
KEY `time` (`time`),
KEY `client_guest` (`client_id`, `guest`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change to client_id_guest to match with the other PR?

@joomla-cms-bot
Copy link
Copy Markdown

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/22668

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Feb 22, 2019

Please test PR #23650


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22668.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants