Skip to content
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

Refactor permission queries to joins #1067

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

ZakarFin
Copy link
Member

@ZakarFin ZakarFin commented Aug 26, 2024

On local dev with some 3000 layers. Loading layers from db (with heavy logging so it's not properly measured):

Before:

  • Amount of select queries for permissions: 6097
  • Timing between selected log entries: 11,6s
  • Layerlist response for browser without SQL logging: 4,2s

After:

  • Amount of select queries for permissions: 15
  • Timing between selected log entries: 3,9s
  • Layerlist response for browser without SQL logging: 3,6s

Time measured from log entries between:

  • from "GetAppSetupHandler - View ID: 1 created by user -1 is public, access granted for user with id -1 "
  • to "OskariLayerWorker - Returning 2712 / 2928 layers "
    So this includes loading the whole layer list and some other stuff, but with all the sql logging happening which I'm sure adds a lot to it.

In addition, change to OskariLayerWorker to fetch permissions for individual layers instead of full set improved GetAppSetup performance from 2-5seconds down to ~60ms

@ZakarFin ZakarFin marked this pull request as ready for review August 27, 2024 10:39
@ZakarFin ZakarFin added this to the 2.14.0 milestone Aug 27, 2024
@ZakarFin ZakarFin merged commit de6d36e into oskariorg:develop Aug 27, 2024
2 checks passed
@ZakarFin ZakarFin deleted the permission-joins branch August 27, 2024 10:53
@jampukka
Copy link
Member

Looks good

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.

2 participants