LogoLogo
ReleasesHomepageBlogSlack
3.0
3.0
  • Welcome
  • Concept
  • SQLWATCH Database
    • Requirements
      • Permissions
      • Performance Overhead
      • Storage Utilisation
    • Installation
      • Install with dbatools
      • Install with SqlPackage
      • Install with SSMS
      • Deploy from source code
      • Optional Components
      • Upgrade
      • Removal
      • Downgrade
    • Configuration
    • Known Issues
      • Collation conflict
      • Database drift
      • Login failed error when running disk logger
      • Deadlock when creating database
    • Notifications
      • Checks
      • Actions
      • Reports
      • How To
        • Add or modify check
        • Add or modify action
        • Add or modify report
      • Process Flow
    • Large Environments
  • Central Repository
    • Requirements
      • Performance overhead on the remote instance
      • Permissions
    • Installation
      • Removal
      • Upgrade
    • Configuration
    • Known Issues
  • Power BI Dashboard
    • Requirements
      • Permissions
    • Installation
    • Configuration
    • Known Issues
      • Power BI Load Errors
    • Performance
  • Grafana Dashboard
    • Requirements
    • Installation
    • Configuration
  • Azure Log Analytics Dashboard
    • Concept
    • Requirements
    • Installation
    • Configuration
  • Design Decision
    • Relations
    • Trend Tables
    • Data Types
      • Real Type
    • Primary Keys
    • Data Compression
    • Configuration Items
    • Using Apply instead of Join
  • Reference
    • Data-Tier Application Package
  • Integrations
    • Send notifications to Slack and Teams
    • dbachecks
  • FAQ
    • How do I check if SQLWATCH is running OK?
    • I am not seeing any data in Power BI
    • Can I modify default checks?
    • The app_log is growing fast
Powered by GitBook
On this page

Was this helpful?

  1. Design Decision

Data Types

PreviousTrend TablesNextReal Type

Last updated 5 years ago

Was this helpful?

Smallest possible data types were used where possible. In case of identity fields, it is always recommended to start with the leftmost value, for example, for smallint we should start with -32768:

IDENTITY(-32768,1)

This doubles the capacity of the identity field vs when starting from zero. However, when using page or row compression, the following applies:

From Microsoft Docs:

Which means that if we use smallint data type (2 bytes) and start identity from 0, it will only use 1 bytes until 2 bytes are required to accommodate the value. Therefore it is of benefit to start identity at 0, rather than negative leftmost value. If capacity is of concern, it is of more benefit to change the data type to int or bigint and still start at zero. When it comes to worst and system runs out of identify values, we can reseed with negative values.

https://docs.microsoft.com/en-us/sql/relational-databases/data-compression/row-compression-implementation