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

D-query hangs when running example code #653

Open
robredpath opened this issue Nov 28, 2023 · 4 comments
Open

D-query hangs when running example code #653

robredpath opened this issue Nov 28, 2023 · 4 comments
Labels

Comments

@robredpath
Copy link
Contributor

robredpath commented Nov 28, 2023

Brief Description

Using the menu controls to populate the query box with the "select organisation" example query and then attempting to run it results in the application hanging

Severity
Medium

Issue Location
http://d-portal.org/dquery/

Steps to Reproduce

Go to http://d-portal.org/dquery/
Click Examples -> Select Organisation
Click Run

Expected Results/Behaviour
Query results to be displayed in the right-hand pane

Actual Results/Behaviour

Screenshot 2023-11-28 at 09 30 55

Notes

This happens in both Safari and Chrome on macOS (latest everything, running on Intel). No adblocking.

Other queries work fine.

@xriss
Copy link
Collaborator

xriss commented Nov 28, 2023

Not sure how to fix, this gets 10 random org files, however some org files are huge and if we are unlucky we get some of the big ones as results and then the browser runs out of memory displaying it.

The unluckiness happens at import time not at query time so it is currently locked in until tomorrow.

Maybe including an "order by pid" to stop it being random?

https://d-portal.org/dquery/#%0Aselect%0A%0A*%0A%0Afrom%20xson%20where%20root='/iati-organisations/iati-organisation'%0A%0Aorder%20by%20pid%20limit%2010;%0A%0A

@xriss
Copy link
Collaborator

xriss commented Nov 28, 2023

Since this is a data problem other possible solutions are.

  1. Use a simple text only view if the result of a query is bigger than X where X is a large number. Should work, might be annoying if we pick too small a large number.

  2. Switch to a spread sheet view, which I would like to do but have not found an open source javascript in browser spreadsheet library that I like, and of course this may still go horribly wrong with large query results depending on the library.

  3. Tell publishers not to make such huge org files and give them a way to report organisation level budget data inside multiple files.

I advise we do all 3 :)

@robredpath
Copy link
Contributor Author

Thanks, @xriss !

If I click the link above then click "Run" I get a very similar problem: it appears to hang (long enough that I gave up and started writing this update...), but it does eventually complete. Maybe I'm only moderately unlucky today?

I like those solutions, @xriss - a simple text view for large results is fine, IMO, as would not trying to render the results at all but letting the user download them as a text file (with an appropriate message in the right-hand pane).

As a further alternative, we could change the example query to be what I was expecting when I clicked the button, which was a query of the form "SELECT * FROM organisations WHERE org-id = "GB-COH-12345" . Presumably we can then choose an organisation that we know has a sensible query size.

@notshi notshi added the Data label Dec 4, 2023
@notshi
Copy link
Collaborator

notshi commented Jan 23, 2024

Thanks, @robredpath - the example query is now updated with your suggestion.

I've also added comments for all the example queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants