0

I am new to sql database, Profiler. I have an application (with no source code access) and it is connected to sql database. There are multiple views and stored procedure.

How to find out/filter out if web application is using sql views from sql Profiler?

Jacob H
  • 2,455
  • 1
  • 12
  • 29
geek
  • 794
  • 3
  • 16
  • 41
  • 3
    Is it actually MySQL or MS SQL Server? I assume the latter because it has a tool called Profiler. You can edit the filters to include only a specific SPID (if you know it) or the application name that is executing the queries. When you are configuring a trace, this will be under "Event Selection" (check view all columns) then click "Column Filters". If you want to filter on a specific view only, you can use the object name. There are a few ways to approach this. – Jacob H Nov 06 '19 at 16:02
  • @JacobH MySQL also has a profiler.. -> [SHOW PROFILE syntax](https://dev.mysql.com/doc/refman/8.0/en/show-profile.html) – Raymond Nijland Nov 06 '19 at 16:17
  • @RaymondNijland Good to know. Either way the tags on this post make no sense. :) – Jacob H Nov 06 '19 at 16:17
  • *"Either way the tags on this post make no sense. :) "* very much agreeing on that. @JacobH :-) – Raymond Nijland Nov 06 '19 at 16:18
  • 1
    In any case, the MySQL query profiler would not tell you if you're using a view. I suspect the OP is using Microsoft SQL Server. The number of posts I see from Microsoft users who tag their question [tag:mysql] gives me a pretty poor opinion of Microsoft users. Perhaps something about using Microsoft makes one unable to read past the first syllable? So they think "my...sql" and "mi...crosoft" are the same word? – Bill Karwin Nov 06 '19 at 16:22
  • *"In any case, the MySQL query profiler would not tell you if you're using a view. "* Fair enough @BillKarwin MySQL's profiler is more about showing a "global" performance view. of a query it indeed does not show which resources are used.. . *"So they think "my...sql" and "mi...crosoft" are the same word?"* yea the mistagging on SQL Server happens alot the [SQL tag](https://stackoverflow.com/tags/sql/info) is also heavy misused for tagging SQL server.questions.. . – Raymond Nijland Nov 06 '19 at 16:42
  • *" because SQL beginners assume that SQL is one language and that's the free product they used. "* @JacobH most likely everything is tagged as `SQL` instead by beginners on this website. My**SQL**, **SQL** Server , **SQL**ite and Postgre**SQL** ... – Raymond Nijland Nov 06 '19 at 16:48
  • @BillKarwin If we're going to go there, why is MySQL incapable of capturing something simple like a view while tracing? I'll concede that I'm an idiot. But is there a good reason why such a basic feature doesn't exist for MySQL? Because I've generally got a poor opinion of MySQL, as I'm constantly coming across misfeatures (GROUP BY?) and lacking features, but you could change my mind here. – Jacob H Nov 06 '19 at 18:05
  • The query profiler is not a query trace. It just measures the time for different phases of query execution. Like parsing SQL, reading rows, sorting results, transferring result set to client, etc. It's not a query trace. There's an advantage to keeping such commands simple, instead of overloading them with too much information. Maybe this speaks to the UNIX philosophy of making each command "do one thing and do it well" vs. what appears to be the Microsoft philosophy of "load it up with lots of features and make them configurable with toolbars." – Bill Karwin Nov 06 '19 at 19:02
  • As for GROUP BY, this has been fixed for many years by changing the [SQL mode](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_only_full_group_by), but it took years to make the correct SQL mode the default. These things have to be changed gradually when you have many users who depend on the old behavior. Even at my company this year, we try to provision new databases with the proper SQL mode, and developers complain that legacy code won't work, so can we please change the SQL mode to the old way? It breaks my heart. – Bill Karwin Nov 06 '19 at 19:04

0 Answers0