patternMinor
Find actual data size from a query?
Viewed 0 times
actualsizequeryfindfromdata
Problem
Is it possible to find the size of data that will be returned by a particular query?
For example, I can use the following to find the number of rows per date:
But is there a way to find out the size of the data that is contained in those rows?
e.g.
Even if it's one query per date that's not a problem.
For example, I can use the following to find the number of rows per date:
select mydatecolumn, count(*)
from MyTable
where mydatecolumn < '01-JAN-2014'
group by mydatecolumnBut is there a way to find out the size of the data that is contained in those rows?
e.g.
select mydatecolumn, "sizeofactualdata",
from mytable
where mydatecolumn < '01-JAN-2014'
group by mydatecolumnEven if it's one query per date that's not a problem.
Solution
Here is a way of How to calculate the Result Set data size
If using Management Studio:
Go to Menu >> Query >> Include Client Statistics
Once you enable the client statistics, it will display another tab in the result span; when clicked, we obtain the following:
As shown in the image, it will capture details for different trials and they are compared with each other. Green arrows indicate improved statistics and red arrows indicate degrading statistics. Please note that here an increase does not always imply a good result; sometimes some statistics when marked as “up” can imply a bad result as well. For the same reason, they are colored in green and red, signifying good and bad results, respectively.
If using Management Studio:
Go to Menu >> Query >> Include Client Statistics
Once you enable the client statistics, it will display another tab in the result span; when clicked, we obtain the following:
As shown in the image, it will capture details for different trials and they are compared with each other. Green arrows indicate improved statistics and red arrows indicate degrading statistics. Please note that here an increase does not always imply a good result; sometimes some statistics when marked as “up” can imply a bad result as well. For the same reason, they are colored in green and red, signifying good and bad results, respectively.
Context
StackExchange Database Administrators Q#62206, answer score: 7
Revisions (0)
No revisions yet.