Title: Improve performance of utPLSQL cache · Issue #778 · utPLSQL/utPLSQL · GitHub
Open Graph Title: Improve performance of utPLSQL cache · Issue #778 · utPLSQL/utPLSQL
X Title: Improve performance of utPLSQL cache · Issue #778 · utPLSQL/utPLSQL
Description: Background Currently, utPLSQL treats all users the same way, regardless of their privileges. This means, that we always need to check what objects are visible to user and we assume minimal privileges when scanning for annotations. The on...
Open Graph Description: Background Currently, utPLSQL treats all users the same way, regardless of their privileges. This means, that we always need to check what objects are visible to user and we assume minimal privileg...
X Description: Background Currently, utPLSQL treats all users the same way, regardless of their privileges. This means, that we always need to check what objects are visible to user and we assume minimal privileg...
Opengraph URL: https://github.com/utPLSQL/utPLSQL/issues/778
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve performance of utPLSQL cache","articleBody":"# Background\r\nCurrently, utPLSQL treats all users the same way, regardless of their privileges.\r\nThis means, that we always need to check what objects are visible to user and we assume minimal privileges when scanning for annotations.\r\nThe only performance boost we get is when user has access to `dba_objects` and `dba_source`.\r\nFramework however does not alter any logic based on user privileges to simplify scanning or boost performance by any means.\r\n\r\nThe slowest part of annotation parsing is retrieval of source code from data dictionary.\r\nDespite cache introduced in version 3.0.4 (#492), we still need to check for cache validity and re-scan changed objects.\r\nThe current solution is better than no cache at all but still far from perfect.\r\n\r\n# Analysis\r\nThere are 3 possible scenarios:\r\n1. User doesn't have any elevated privs on schema containing test pacakges\r\n - utPSLQL cannot cleanup cache for schema, as cache might contain objects not accessible to user and those objects would get deleted from cache\r\n - utPSLQL needs to join to all_source when retrieving suites (or skip suites not accessible to user), as cache might contain objects not accessible to user and those would fail to execute on missing privileges\r\n2. User can execute all procedures in schema (owner or has execute any procedure)\r\n - utPLSQL can cleanup cache for schema, as user can see all packages\r\n - utPLSQL can retrieve all pacakges from cache and skip join to all_source when retrieving suites as user can see execute all packages in schema\r\n3. User can access dba_source & dba_objects\r\n - utPLSQL can cleanup cache for schema, as user can see all packages\r\n - utPLSQL needs to join to all_source when retrieving suites (or skip suites not accessible to user), as cache might contain objects not accessible to user and those would fail to execute on missing privileges\r\n\r\n**To summarize**\r\nIf user owns the schema, or user has execute any procedure privilege then.\r\n1. When scanning - we see whole schema packages\r\n2. When scanning - we can detect dropped packages safely (as we see all packages, not only those granted) and so we can remove those from cache\r\n3. No need to join with all_objects - we can skip the join.\r\n\r\n# Cache solution\r\n\r\nCache will return only data for annotated objects / suites that are visible to user invoking utPLSQL.\r\nCache will be cleaned up from dropped packages when possible (when invoking user can see all packages in schema)\r\n\r\n# Details\r\n\r\n- If user can access all code in schema:\r\n - Sources are scanned by last modified date > last full scan date\r\n - Cache is populated with scanned source\r\n - Cache is purged by deleting objects that no longer existing\r\n - Cache full scan date is updated for schema\r\n - Data from cache is retrieved without joining with all objects\r\n- If user has access to DBA source and DBA objects but cannot access all code in schema \r\n - Sources are scanned by last modified date > last full scan date\r\n - Cache is populated with scanned source\r\n - Cache is purged by deleting objects that no longer existing\r\n - Cache full scan date is updated for schema\r\n - Data from cache is retrieved by joining with all objects\r\n- If user cannot access DBA source and cannot access all code in schema \r\n - Sources are scanned by last modified date > last full scan date\r\n - Cache is populated with scanned source\r\n - Data from cache is retrieved by joining with all objects\r\n\r\nRelated to: #757 \r\n\r\n","author":{"url":"https://github.com/jgebal","@type":"Person","name":"jgebal"},"datePublished":"2018-11-07T23:11:00Z","url":"https://github.com/utPLSQL/utPLSQL/issues/778"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c2f36ab1-d0b5-8529-0524-28a9e7180950 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9DA:2F3E36:376D41:4C3488:6B04BCBF |
| html-safe-nonce | 928cf6f2b9f35dd7d1a22f47cd7499089e91d72b3ad6ef97556057623b54960e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOURBOjJGM0UzNjozNzZENDE6NEMzNDg4OjZCMDRCQ0JGIiwidmlzaXRvcl9pZCI6Ijc0NjI1OTgyNDM3MzA2MzU5NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e217bcc7d572010ed6897411cb1bf57532d2653eafc98383dcbf122ab7d99386 |
| hovercard-subject-tag | issue:378509367 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/utPLSQL/utPLSQL/778/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e9a5c90127e3c93ebfe5d1ecc2ac49d57f867154ffa75a7ba394af92516880ca/utPLSQL/utPLSQL/issues/778 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e9a5c90127e3c93ebfe5d1ecc2ac49d57f867154ffa75a7ba394af92516880ca/utPLSQL/utPLSQL/issues/778 |
| og:image:alt | Background Currently, utPLSQL treats all users the same way, regardless of their privileges. This means, that we always need to check what objects are visible to user and we assume minimal privileg... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jgebal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/utPLSQL/utPLSQL git https://github.com/utPLSQL/utPLSQL.git |
| octolytics-dimension-user_id | 15661281 |
| octolytics-dimension-user_login | utPLSQL |
| octolytics-dimension-repository_id | 50728220 |
| octolytics-dimension-repository_nwo | utPLSQL/utPLSQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 50728220 |
| octolytics-dimension-repository_network_root_nwo | utPLSQL/utPLSQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width