How to remove tag from SelectQuery object I process SelectQuery object using hook_query_TAG_after() or hook_query_alter().

I want to remove 'mytag' tag, which has been added as $query-&gt;addTag('mytag') somewhere else. Apparently, neither SelectQuery, nor QueryAlterableInterface has appropriate interface method.

Is there any means (besides SelectQuery subclassing) that I can use to remove a tag?

The reason may be the following (thanks Clive for asking):

I want to make a decision based on (expected) record set size inside hook_query_TAG_after()

I could do $countQuery = $query-&gt;countQuery(); $total = $countQuery-&gt;execute()-&gt;fetchField()

But, the cloned query will have same tag as original one and execute() will invoke the same hook ad infinitum.
I still can not find a way to remove a tag from query, but I found solution for my case of count query. The idea is to use another tag to stop endless recursion:

function mymodule_query_mytag_alter(QueryAlterableInterface $query) {

  if ($query-&gt;hasTag('counted')) {
    return;
  }

  // Prepare count query
  $countQuery = $query-&gt;countQuery();
  $countQuery-&gt;addTag('counted'); // Abort hook recursion

  $tables =&amp; $countQuery-&gt;getTables(); // Query may have sub-queries

  foreach ($tables as &amp;$table) { // Tag all subqueries
    if ($table['table'] instanceof SelectQueryInterface) {
      $table['table']-&gt;addTag('counted'); // Abort hook recursion
    }
  }

  $total = $countQuery-&gt;execute()-&gt;fetchField(); // execute() will initiate recursion!

 // Rest of processing

}