float vs int

  • GilaMonster (3/11/2014)


    yuvipoy (3/11/2014)


    I am just asking will there be inprovement if there the data type is Int

    Improvement over what?

    Improvement over Float.

  • Goes back to the question, do you have a performance problem? If not and this is an existing table, leave it alone. If no and this is a new table, use the logical data type for the data you are storing.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • yuvipoy (3/11/2014)


    GilaMonster (3/11/2014)


    yuvipoy (3/11/2014)


    I am just asking will there be inprovement if there the data type is Int

    Improvement over what?

    Improvement over Float.

    Don't worry about that.

    Are you storing integer style data? Yes? Use the integer style data type. Period. There's no reason to use FLOAT instead of INT if you're not taking advantage of what FLOAT does for you (floating decimal points). It's that simple. It has nothing to do with performance. I'm fairly certain, if you tested it out, performance between the two is likely to be either identical, or near enough to not make a difference. Store the data in data types that accurately reflect what the data is. Dates go into DATE, date and time go into DATETIME, descriptive information goes into VARCHAR, integers go into INT (or BIGINT if you need that much). That's the right way to design stuff.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Grant Fritchey (3/11/2014)


    Store the data in data types that accurately reflect what the data is. Dates go into DATE, date and time go into DATETIME,

    Or, preferably, DATETIME2 - this is an SQL 2008 forum, isn't it?

    Tom

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply