Is your feature request related to a problem? Please describe.
If the session handler is database, Joomla\CMS\Session\MetadataManager::checkSessionRecordExists()
performs an extra database query which is is actually actually useless.
Describe the solution you'd like
This method is executed onAfterSessionStart
, hence the record in #__session
always exists if a session is stored in the database.
For database session storage we can omit the check for table record presence because it always exists at this stage (sure if the session is in Active state).
Sorry, no time for PR, here is the sample code for
Joomla\CMS\Session\MetadataManager::createOrUpdateRecord()