初步的想法....

基本上我能想到兩個solution

1.如果用collection的話,受.net限製

a.隻能用線性的collection

b.用singleton or static使其唯一並cache

c.如果要寫自己的algorithm,必須要先sort,然後類似於binary search的方法找。(interesting part~~)

d.用linq to object?(有沒有like 這個keyword?not sure,LP把我laptop拿走了,這台機器沒有vs2008)

不知道linq背後的機製,感覺如果每次它search的時候都要先sort再search,或者在memory build bst? 毫無疑問,這個開銷很大。

2.用sql server,

a. 把這些data作one column table.

b.作clustered index.

c.用linq to sql,這個一定有like. 或者用store procedure,這個還有cache,而且clustered index search都用logic read,性能更好些,推薦用sp。

d.從來沒用過sql server 2005 Native Web Services,感覺這是一個很重要的突破口,我沒有用過這個,需要看看相應的document.

e.這個solution不好的地方就是有對sql server發起的query和網絡的傳輸,開銷也不小。好的地方就是我們不用關心algorithm&cache,不用再application server那邊占用那麽大的資源。db那邊就搞定了,而且可以用傳統的方法實現。

上麵兩個solution應該要在大數據量下做simulation test,然後才能知道誰更優。

let's leave it open.等我們再看看相應的article,再交流叭~~

所有跟帖: 

補充:solution 1可以用regular expresion,當然... -澳洲老土- 給 澳洲老土 發送悄悄話 (66 bytes) () 01/20/2009 postreply 23:15:58

For solution 2. read this..... -澳洲老土- 給 澳洲老土 發送悄悄話 (419 bytes) () 01/21/2009 postreply 00:15:36

Thanks a lot. You gave me some additional leads. -catcherintherye- 給 catcherintherye 發送悄悄話 (0 bytes) () 01/21/2009 postreply 14:44:10

請您先登陸,再發跟帖!