初步的想法....

来源: 澳洲老土 2009-01-20 23:05:43 [] [旧帖] [给我悄悄话] 本文已被阅读: 次 (1191 bytes)
基本上我能想到两个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

请您先登陆,再发跟帖!

发现Adblock插件

如要继续浏览
请支持本站 请务必在本站关闭/移除任何Adblock

关闭Adblock后 请点击

请参考如何关闭Adblock/Adblock plus

安装Adblock plus用户请点击浏览器图标
选择“Disable on www.wenxuecity.com”

安装Adblock用户请点击图标
选择“don't run on pages on this domain”