Created
June 18, 2024 12:13
-
-
Save Migaroez/a26e0659f1bce3e442722e4c670531b9 to your computer and use it in GitHub Desktop.
Rough Umbraco node size estimation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select un.uniqueId, cv.nodeId, cv.id as versionId, totalVersionSize.totalValueSize, versionPropertyCount.propAmount | |
| FROM umbracoContentVersion cv | |
| left join ( | |
| SELECT versionId, Sum( | |
| (coalesce(DATALENGTH([intValue]),0) | |
| +coalesce(DATALENGTH([decimalValue]),0) | |
| +coalesce(DATALENGTH([dateValue]),0) | |
| +coalesce(DATALENGTH([varcharValue]),0) | |
| +coalesce(DATALENGTH([textValue]),0))) | |
| AS totalValueSize | |
| FROM umbracoPropertyData | |
| group by versionId | |
| ) as totalVersionSize on totalVersionSize.versionId = cv.id | |
| left join ( | |
| select pd.versionId, count(distinct pd.id) as propAmount | |
| FROM umbracoPropertyData pd | |
| group by versionId | |
| ) as versionPropertyCount on versionPropertyCount.versionId = cv.id | |
| left join umbracoNode un on un.id = cv.nodeId | |
| order by totalVersionSize.totalValueSize desc | |
| select un.uniqueId, cv.nodeId, cv.id as versionId, totalVersionSize.totalValueSize, versionPropertyCount.propAmount | |
| FROM umbracoContentVersion cv | |
| left join ( | |
| SELECT versionId, Sum( | |
| (coalesce(DATALENGTH([intValue]),0) | |
| +coalesce(DATALENGTH([decimalValue]),0) | |
| +coalesce(DATALENGTH([dateValue]),0) | |
| +coalesce(DATALENGTH([varcharValue]),0) | |
| +coalesce(DATALENGTH([textValue]),0))) | |
| AS totalValueSize | |
| FROM umbracoPropertyData | |
| group by versionId | |
| ) as totalVersionSize on totalVersionSize.versionId = cv.id | |
| left join ( | |
| select pd.versionId, count(distinct pd.id) as propAmount | |
| FROM umbracoPropertyData pd | |
| group by versionId | |
| ) as versionPropertyCount on versionPropertyCount.versionId = cv.id | |
| left join umbracoNode un on un.id = cv.nodeId | |
| order by versionPropertyCount.propAmount desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment