One 400GB table, One query - Need Tuning Ideas (SQL2005)

后端 未结 24 2120
予麋鹿
予麋鹿 2021-01-30 15:03

I have a single large table which I would like to optimize. I\'m using MS-SQL 2005 server. I\'ll try to describe how it is used and if anyone has any suggestions I would appreci

24条回答
  •  梦谈多话
    2021-01-30 15:39

    That sounds like good fun.

    A few questions:

    • Why did you choose these types ? varchar, money, bigint, int, bool ? is there a reason or just willing to add some good fun?
    • By any chance we could get have a look the insert statement, or TSQL or the bulkinsert ?
    • Can you tell how often your insert happens (is it a bulk, or random ?)
    • Does the DateTime field contains the date of insert ?
    • How did you came to this ? (a one man/day thinking or a team of 20 people working like crazy for the last three months ?)

    A few facts seems important to me:

    • You insert a million row every day
    • You want only the last million data

    A few remarks came to me:

    • if you're interested only in the last data, deleting/archiving the useless data could make sense (start from scratch every morning)
    • if there is only one "inserter" and only one "reader", you may want to switch to a specialised type (hashmap/list/deque/stack) or something more elaborated, in a programming language.

提交回复
热议问题