Skip to content

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

@maskaravivek

Description

@maskaravivek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions