avatar
微博真是小世界# Joke - 肚皮舞运动
l*9
1
I need to do a fast search in a column with floating point numbers in a
table of SQL server 2008 R2 on Win 7.
the table has 10 million records.
e.g.
Id value
532 937598.32421
873 501223.3452
741 9797327.231
ID is primary key, I need o do a search on "value" column for a given value
such that I can find the 5 closest points to the given point in the table.
The closeness is defined as the absolute value of the difference between the
given value and column value.
The smaller value, the closer.
I would like to use binary search.
I want to set an unique index on the value column.
But, I am not sure whether the table will be sorted every time when I search
the given value in the column ?
Or, it only sorts the table one time because I have set the value column as
unique index ?
Are there better ways to do this search ?
Any help would be appreciated.
thanks
avatar
c*m
2
周日路过CVS的时候特意看了一下卖不卖Dreft,价钱是11.xx。有别的事,嫌拎着重没
买。今天特意跑去买,发现一模一样的东西变成13.49了,也忒狠了吧?愤愤地回来了
有别的合算一点的买法吗?谢谢
avatar
C*F
3
【 以下文字转载自 pets 讨论区 】
发信人: csboy2007 (我叫包守腿。。来自火星的宇宙无敌包子控), 信区: pets
标 题: 休想抢我的地盘 (转载)
发信站: BBS 未名空间站 (Wed Apr 13 12:43:29 2011, 美东)
发信人: renaissance (ole), 信区: Joke
标 题: 休想抢我的地盘
发信站: BBS 未名空间站 (Wed Apr 13 12:42:45 2011, 美东)
老大睡沙发.jpg
avatar
x*o
4
h
avatar
f*d
5
as long as value is a clustered index, it should be fine.
doesn't matter if it's unique or not. (actually it shouldn't be unique)
avatar
b*h
6
沃玛特

【在 c**m 的大作中提到】
: 周日路过CVS的时候特意看了一下卖不卖Dreft,价钱是11.xx。有别的事,嫌拎着重没
: 买。今天特意跑去买,发现一模一样的东西变成13.49了,也忒狠了吧?愤愤地回来了
: 有别的合算一点的买法吗?谢谢

avatar
h*s
7
sf
avatar
H*g
8
收音机头疼 是个名人吗?
avatar
V*T
9
这是哪儿?

【在 b********h 的大作中提到】
: 沃玛特
avatar
h*u
10

我有类似的一张。哈哈

【在 C*F 的大作中提到】
: 【 以下文字转载自 pets 讨论区 】
: 发信人: csboy2007 (我叫包守腿。。来自火星的宇宙无敌包子控), 信区: pets
: 标 题: 休想抢我的地盘 (转载)
: 发信站: BBS 未名空间站 (Wed Apr 13 12:43:29 2011, 美东)
: 发信人: renaissance (ole), 信区: Joke
: 标 题: 休想抢我的地盘
: 发信站: BBS 未名空间站 (Wed Apr 13 12:42:45 2011, 美东)
: 老大睡沙发.jpg

avatar
l*o
11
司马男连个司机都没混上。
avatar
s*c
12
walmart

【在 V********T 的大作中提到】
: 这是哪儿?
avatar
l*t
13
没有第一张第二张打死都想不到是这厮
avatar
s*m
14
右边那个是给挤了的后果,没啥好攀比的。

【在 x****o 的大作中提到】
: h
avatar
f*p
15
这是一对傻逼呀。真是应的那句话,傻逼都是成对出现的。
avatar
r*g
16
用的是三星啊。。怎么不用华为的。
avatar
H*9
17
呵呵,说小不小,说大不大
avatar
t*t
18


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