3

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:

select mydatecolumn, count(*) 
from MyTable
where mydatecolumn < '01-JAN-2014'
group by mydatecolumn

But 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 mydatecolumn

Even if it's one query per date that's not a problem.

3
  • "Size" is not a property of "data". Commented Apr 1, 2014 at 9:42
  • 1
    I think you need to ask "How to calculate the Result Set data size ?"
    – Up_One
    Commented Apr 1, 2014 at 11:46
  • Probably a better way of putting it!
    – BlueChippy
    Commented Apr 2, 2014 at 11:33

1 Answer 1

7

Here is a way of How to calculate the Result Set data size

If using Management Studio:
Go to Menu >> Query >> Include Client Statistics enter image description here
Once you enable the client statistics, it will display another tab in the result span; when clicked, we obtain the following: enter image description here

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.