[GIS] How to get size of SDE geodatabase feature class

arcpyenterprise-geodatabase

Is there a way in catalog or arcpy to determine the amount of hard drive space a SDE feature class takes up on disk?

In catalog the 'size' column is blank and Esri help states:

The size, modification date, and read/write columns apply to several file-based objects, such as maps and shapefiles. No values will appear in these columns for data stored in a database or file-based objects that don't support retrieving that information from the file system.

As for arcpy, I have not see a property of any Describe object that can call size or read/write for that matter. The answer question How to get size of file geodatabase feature class on disk? provides the solution for a file GDB, but how can it be done for SDE feature classes?

Best Answer

I'm a dba rather than a GIS guy, so I hope this is useful.

I respect the comments from the other users that getting this info from a db can be difficult or misleading, however assuming you have sql query access you should be able to work this out for most if not all db implementations.

What database are you using? I assume a feature would translate to a single row in a table. Are you looking for an average? The total for the table, or kb for a specific row?

Assuming sql server: sp_spaceused tablename will give you kb's used, rows, used space and unused. So you can work out total and average.

If you can identify a specific row you could select that into a #temp table and run sp_spaceused on that.

A table will use a minimum of 1 page or 8kb. So if your feature is less than that it might be harder to calculate. I guess you could insert the same row n times and then divide by n.

Can you tell us more about what you are trying to achieve and/or why?