How to count size of archive?

zbychad

Active Newcomer
Joined
Oct 21, 2007
Messages
6
Reaction score
0
Points
0
Location
Krakow, Poland
Hello,

I'm looking for SQL query which would allow me to calculate size of an archive. I've tried that one:

SELECT Sum(File_Size) FROM Contents WHERE Object_ID IN (SELECT Object_ID FROM Archives WHERE Description = <DESCRIPTION> AND Archive_Date = <DATE> AND Node_Name = <NODE>)

....which takes inifinite hours to complete on 60GB db.

Best regards,
Zbigniew Adamkiewicz
 
Hello zbychad,

An idea (and I'm sure there might be a nicer way as well), but if this is only an ad-hoc query have you considered performing the query from/as the client instead?

For example, issuing a `dsmc query archive -description='<description>'` is far quicker than a server-side select from the ARCHIVES table. Of course, you'd need to perform some further processing on the output to get the overall size.

HTH,
_________
David Mc
London, UK
 
Perfect suggestion!

That gave me the exact value in GB from the client side in a seconds (!!):

dsmc query archive -desc="ARCHIVE_DESC" -subdir=yes "/<path>/*"| grep 'B' | awk '{ print $1 }' | tr -d ',' | awk '{ sum+=$1} END {print sum/1024/1024/1024}'

Thanks,
Zbigniew Adamkiewicz
 
Back
Top