m******y 发帖数: 588 | 1 我们有些巨大无比的report table, 每个table有200多个columns, 所有run同样的
report的用户share同一个report table, 用session identifier区分。 有的user不用
filter, 可以generate出来half million records and insert into report table,
有的只有几千几百rows. 因为有很多的insert and update, 所以report table 没有任
何index. 现在问题是:
1 有大的insert 和 update 非常慢。
2 用户之间影响非常大。 如果一个用户report 结果只有几百rows, but another
user has over half million records generated and inserted in the same table,
then 那个用户即使只有几百rows, 做insert, update 也无比的慢。
我现在没法改table structure和logic or hardware, 请 | x***e 发帖数: 2449 | 2 serious.
上中下三策。
上中已经被你排除了。
now, you need some serious codings and configurations to do.
idea 1) use temp table.
basically, you wanna create a view, including the report table and at least
a temp table.
when people do insert, always insert to the empty temp table first.
then you will get the row count, if the row count is small,
then insert/update it to the report table, if big, danamically create a new
temp table,
and include the 3 table into the view, so the table list in the view grows,
instea
【在 m******y 的大作中提到】 : 我们有些巨大无比的report table, 每个table有200多个columns, 所有run同样的 : report的用户share同一个report table, 用session identifier区分。 有的user不用 : filter, 可以generate出来half million records and insert into report table, : 有的只有几千几百rows. 因为有很多的insert and update, 所以report table 没有任 : 何index. 现在问题是: : 1 有大的insert 和 update 非常慢。 : 2 用户之间影响非常大。 如果一个用户report 结果只有几百rows, but another : user has over half million records generated and inserted in the same table, : then 那个用户即使只有几百rows, 做insert, update 也无比的慢。 : 我现在没法改table structure和logic or hardware, 请
| m******y 发帖数: 588 | 3 Thanks for the reply. But it seems both solutions will involve kind of
report app code changing. :( | x***e 发帖数: 2449 | 4 I still think the best/easiest way is to change table structure and/or add
hardware
【在 m******y 的大作中提到】 : Thanks for the reply. But it seems both solutions will involve kind of : report app code changing. :(
| t*****g 发帖数: 1275 | 5 啥database?支持dirty read么?
table,
【在 m******y 的大作中提到】 : 我们有些巨大无比的report table, 每个table有200多个columns, 所有run同样的 : report的用户share同一个report table, 用session identifier区分。 有的user不用 : filter, 可以generate出来half million records and insert into report table, : 有的只有几千几百rows. 因为有很多的insert and update, 所以report table 没有任 : 何index. 现在问题是: : 1 有大的insert 和 update 非常慢。 : 2 用户之间影响非常大。 如果一个用户report 结果只有几百rows, but another : user has over half million records generated and inserted in the same table, : then 那个用户即使只有几百rows, 做insert, update 也无比的慢。 : 我现在没法改table structure和logic or hardware, 请
|
|