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

performance issue: do not trigger unnecessarily graphql/rdf queries (i.e. preview) #1193

Closed
2 tasks done
Rdataflow opened this issue Sep 24, 2023 · 0 comments · Fixed by #1236
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@Rdataflow
Copy link
Contributor

Rdataflow commented Sep 24, 2023

Describe the bug
Calling up the preview page triggers unecessarily graphql and subsequently RDF queries. 👀

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://int.visualize.admin.ch/browse?dataset=https%3A%2F%2Fenvironment.ld.admin.ch%2Ffoen%2Ffab_forestry_normalized%2F16&dataSource=Int&debug__flag=true
  2. Click on debug tool
  3. See list of triggered queries with redundant information or even queries / answears out of scope. (i.e. List of published cubes, while previewing )
    image

Expected behavior
Trigger the relevant queries only avoiding the unnecessary ones. This helps to offload the endpoint and gain speed at the same time...

Environment (please complete the following information):

  • Visualize environment and version: TEST v3.22.7 (9e9daeb)

Additional context

  • All the needed information is queried already in DataCubeMetadata and DataCubePreview.
  • Thus it's unnecessary to fire the following queries
    - Themes (whole list of Themes not needed here)
    export function useThemesQuery(options: Omit<Urql.UseQueryArgs<ThemesQueryVariables>, 'query'> = {}) {

    - Organizations (whole list of Organizations not needed here)
    export function useOrganizationsQuery(options: Omit<Urql.UseQueryArgs<OrganizationsQueryVariables>, 'query'> = {}) {

    - DataCubes (whole list of Published DataCubes not needed here)
    export function useDataCubesQuery(options: Omit<Urql.UseQueryArgs<DataCubesQueryVariables>, 'query'> = {}) {

NB: The same might happen in other places / on other pages as well.

@Rdataflow Rdataflow added the bug Something isn't working label Sep 24, 2023
@bprusinowski bprusinowski self-assigned this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants