sql - DB Performance and data types -


I am supporting an existing application written by another developer and I have a question whether the data developer likes The dates have been chosen to store dates, affecting the performance of some specific questions.

Relevant information: In one of our tables, there is a heavy use of the "business date" field. Data type for this business date is nvarchar (10) instead of a datetime data type format of date "MM / DD / YYYY ", so Christmas 2007 is stored as" 12/25/2007 ".

Long story short, we have some heavy duty questions that run once a week and are taking a very long time to execute.

I am writing this application again from the ground, but since I am seeing it, I want to know that there is a distinction between the data usage of the time of data because the dates of the repository

"post-text" itemprop = "text">

If you use datetime instead of nvarchar (10), you save disk space And will increase efficiency.

If you use date-count ( DATEADD etc.) to date-calculate, you will see a large increase in query-execution-speed, because of the field's Not necessarily convert to datetime on runtime.


Comments