How would you store the market id in a mysql database?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • The Edge
    Junior Member
    • Aug 2010
    • 25

    #1

    How would you store the market id in a mysql database?

    From https://api.developer.betfair.com/se...rketCatalogue:

    Code:
    	
    The unique identifier for the market. MarketId's are prefixed with '1.' or '2.' 1. = UK Exchange 2. = AUS Exchange.
    What would be the best way to store it in a MySql database? I've been reading about the decimal data type, but that is supposed to incur a performance penalty http://stackoverflow.com/questions/2...mysql-postgres

    However, if I split it into two fields - exchange and market Id, my code will incur additional complexity.

    At the moment, I am using a string field, but am not sure if that is much better.
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    The marketId is a string - so I would store it as a string.

    Storing it as a decimal would not work anyway. If the marketId ended in zero, then it would be lost when storing it to the database.

    If you REALLY are worried about the performance overhead of decimal v string, then I'm not sure you should be using a database anyway.

    In the grand scheme of things, the performance implications are negligible unless you are doing massively parallel processing.

    Comment

    Working...
    X