avatar
一个没想明白的问题# Programming - 葵花宝典
m*t
1
I have a client that querys server every 1 hour. It stores local cache for
the stuff it downloaded from
server. The client local cache carries a timestamp, called client_time_stamp
. Everytime the client querys
the server, the server compares the client timestamp with a server timestamp
about the data the client
needs. If the data has not changed, the server timestamp will be older than
the cache_time_stamp, thus
the server will just return cache_valid, and client preserves old client_
time_stam
avatar
c*t
2
Basically, create two indices on key A and key B. For join operation,
it is not necessarily slow.
If both sets are small, brute force match would be sufficient.
In your case, the bottle neck could very well be disk seek time
vs disk read time. Actual comparison could be done rather quickly.
Also, if sets are sorted in certain manners, the comparison can be
done efficiently.
The bottomline is that, before you consider some fansy algorithms,
do some tests firsts.

stamp
timestamp
than

【在 m***t 的大作中提到】
: I have a client that querys server every 1 hour. It stores local cache for
: the stuff it downloaded from
: server. The client local cache carries a timestamp, called client_time_stamp
: . Everytime the client querys
: the server, the server compares the client timestamp with a server timestamp
: about the data the client
: needs. If the data has not changed, the server timestamp will be older than
: the cache_time_stamp, thus
: the server will just return cache_valid, and client preserves old client_
: time_stam

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。