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

How to handle limits in ask API? #4878

Open
WolfgangFahl opened this issue Nov 3, 2020 · 2 comments
Open

How to handle limits in ask API? #4878

WolfgangFahl opened this issue Nov 3, 2020 · 2 comments
Labels

Comments

@WolfgangFahl
Copy link
Contributor

WolfgangFahl commented Nov 3, 2020

The issues:

WolfgangFahl/py-3rdparty-mediawiki#11

mwclient/mwclient#263

are linked to each other. When querying the ask api with a limit=x parameter I'd expect that the result would be limited. In mediawiki-japi / simplegraph and in the pywikibot based version this seems to work. The offset-based approach in mwclient somehow seems to ignore the parameter. What is the official behavior when using offset and limit via the ask API?

@hexmode
Copy link
Member

hexmode commented Jul 15, 2021

@WolfgangFahl, I was looking at bugs today and came across your question. Have you tried using a debug log to see what SQL queries are generated? I think I looked into something similar recently and was surprised that SMW did not limit queries.

Since I'm going to be code spelunking, I wonder if you've found any more information about this.

@WolfgangFahl
Copy link
Contributor Author

WolfgangFahl commented Jul 16, 2021

@hexmode thank you for looking into this. A the time when I filed the issue we didn't have the tools for more detailed analysis and we have been working around this in the meantime. Using https://pypi.org/project/pymediawikidocker/ it's now much easier to setup an SMW environment with current versions of extensions and go from there and I could indeed try the debugging. Since we have dozens (actually more than 100) details problems currently in our project this one does not have high priority on our list since the other limit of some 10.000 entries per ask query was hitting us much harder and we used the "queryDivision" approach to get around that one thanks to Tim Holzheim's work.

 -qd QUERYDIVISION, --queryDivision QUERYDIVISION
                        divide query into equidistant subintervals to limit
                        the result size of the individual queries

see http://mediawiki-japi.bitplan.com/index.php/Py-3rdparty-mediawiki#wikibackup

This way the queries are now "unlimited" since internally the query is split.

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

2 participants