Uploaded image for project: 'DayTrader'
  1. DayTrader
  2. DAYTRADER-25

Update decimal precision and indexes in ddl

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2, 2.0
    • None
    • None

    Description

      While working with previous versions of Trade, I found that the monetary values stored in the database could overrun the decimal precision defined in the schema (10,2) if allowed to run for an extended period of time. This would result in SQL exceptions related to data conversion.

      To prevent this we increased the decimal presion to (14,2)

      We also found that some of the indexs were not necessary and that others should be added.

      In addition to the primary keys, here are the indexes we found to be the most useful...

      CREATE INDEX a.profile_userid on accountejb(profile_userid);
      CREATE INDEX h.account_accountid on holdingejb(account_accountid);
      CREATE INDEX o.account_accountid on orderejb(account_accountid);
      CREATE INDEX o.holding_holdingid on orderejb(holding_holdingid);
      CREATE INDEX o.closed_orders on orderejb(account_accountid,orderstatus);

      Will wait to submit a patch until the fate of Daytrader-14 is determined.

      Attachments

        1. daytrader-25.code.patch
          4 kB
          Christopher James Blythe
        2. daytrader-25.schema.patch
          7 kB
          Christopher James Blythe

        Activity

          People

            cjblythe25 Christopher James Blythe
            cjblythe25 Christopher James Blythe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: