不均匀的结果在Amazon SimpleDB上执行排序/排序

时间:2010-02-12 02:17:40

标签: amazon-simpledb

尝试从Amazon SimpleDB请求数字排序的记录列表时,我的结果非常不平衡。

我填充我的数字是为了让他们以lexigraphically方式选择,但仍然没有运气。这两个查询给出了相同的结果,例如:

select * from cbcallers where calls_completed is not null order by calls_completed desc

select * from cbcallers where calls_completed is not null order by calls_completed asc

但是,我使用亚马逊的查询语言得到了正确的结果:

['calls_completed'starts-with ''] sort 'calls_completed' desc

上周,我在同一数据集上从此查询中获得了不同的(无序)结果。任何人都知道怎么了?我的查询是否被抬起?

数据集如下所示:

Sdb-Item-Name, calls_completed, name, icon
8uda23sd7, 0000002, john smith, /myimgicon.jpg
8uda5asd3, 0000015, john smarts, /myimgicon2.jpg
8udassad8, 0000550, john smoogie, /myimgicon3.jpg

1 个答案:

答案 0 :(得分:1)

您的查询看起来完全正确。我加载了您的数据并逐字地使用了您的查询,并得到了您所期望的结果。

升序:

select * from cbcallers where calls_completed is not null order by calls_completed asc
[
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550]

降序:

select * from cbcallers where calls_completed is not null order by calls_completed desc
[
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002]

也许这是您的SimpleDB客户端的问题,您正在使用哪一个,您知道它是否使用最新的SimpleDB API版本(“2009-04-15”)?