How to change default query plugin for views?
Firstly you will need to have defined your query plugin to Views using hook_views_plugins():

function MYMODULE_views_plugins() {
  return array(
    'query' =&gt; array(
      'myplugin' =&gt; array(
        'title' =&gt; 'My custom plugin',
        'handler' =&gt; 'MyCustomQueryClass',
      ),
    ),
  );
}


Then, you should be able to override the query class used for any of the built-in tables using hook_views_data_alter() and setting the query class key in the table base property:

function MYMODULE_views_data_alter(&amp;$data) {
    $data['node']['table']['base']['query class'] = 'myplugin';
}