Is there a way to search for instances of hook_views_query_alter() in my database? I am running a D7 site that someone else built and I'm having trouble seeing how an SQL command in a particular view has been altered. In particular, the attributes in the SELECT statement appear to have been altered.

Is there a way to search my database to see if the person building the site added an errant hook_views_query_alter command that is the reason the SQL filter looks different than one would expect just looking at the fields in the View?

Or is there another, better way to debug this issue? Thanks for any help!
Views field output can also be rewritten under the view's fields setting in the views interface using "rewrite the output of this field" using tokens from previous rows or arbitrary HTML. That's the likeliest place.

If not there, the next candidate for views output modification is in the theme template files. People will stick any kind of logic in views theme template files. To see if custom template files are in use, see "Theme: Information" in the views and the template file in use will be in bold.

Generally, hook_views_query_alter is not the normal way of modifying a view. But a hook_views_query_alter would be added in the code rather than the database. Drupal does cache a list of implemented hook functions in a the theme registry table, but that's not very readable nor informative. Not where you should be looking. Your best bet is to search your code for "_views_query_alter" and see what you turn up. There will be a lot of results, but likely you'll recognize any custom modules.

I might also turn on Show SQL Queries in under Views->Settings to see the output of the views query as views reports it as it's being run in the Views preview interface below the view builder interface. Then you can see the query being run to see if it matches your expectations.

There is also a setting in views under Advanced -> Query to turn off SQL rewriting for a view. This will disable access checks as well as some query rewriting (but not all) so use sparing.