Skip to content

Conversation

@danillofb
Copy link

No description provided.

->fields('wf_job')
->condition('eid', $env_id)
->execute()
->rowCount();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inefficient as it iterates over the result set. Please use countQuery like so:

$results = db_select('wf_job', 'wf_job')
    ->fields('wf_job')
    ->condition('eid', $env_id)
    ->countQuery()
    ->execute()
    ->fetchField();

This will use the database's native COUNT() function.

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 this pull request may close these issues.

2 participants