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

Use a single query for fetching articles using images and unique used images #4

Open
maskaravivek opened this issue Nov 30, 2018 · 0 comments

Comments

@maskaravivek
Copy link
Member

articlesUsingImages and uniqueUsedImages are being fetched from the same table(globalimagelinks ) to it can be merged into a single query.

sql = 'select count(*) as articlesUsingImages, count(distinct gil_to) as uniqueUsedImages from globalimagelinks where gil_to in (select log_title from logging_userindex where log_type="upload" and log_user=(select user_id from user where user_name="%s"));' % username

It would require merging the two methods into a single function but would at least save 1 DB call.

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 a pull request may close this issue.

1 participant