开发者

AWS SimpleDB where clause 'and' operator behaving unexpectedly

开发者 https://www.devze.com 2023-03-24 12:11 出处:网络
The following simpledb query returns 51 results: select * from logger where time > \'2011-07-29 17:45:10.540284+00:00\'

The following simpledb query returns 51 results:

select * from logger where time > '2011-07-29 17:45:10.540284+00:00'

This query returns 20534 results:

开发者_JS百科
select * from logger where time < '2011-07-29 17:50:08.615626'

These two queries both return 0 results!!?:

select * from logger where time between '2011-07-29 17:45:10.540284+00:00' and '2011-07-29 17:50:08.615626'

select * from logger where time > '2011-07-29 17:45:10.540284+00:00' and time < '2011-07-29 17:50:08.615626'

What am I missing here?


But are any of your 51 results returned from the first query actually within the time span you are searching? If they are all later than 17:50:08.615626 then your queries are performing as expected.

I am also suspicious of the fact that you are being inconsistent in how you are representing the time. You should really be using ISO 8601 timestamps if you want consistent lexicographic matching of times with SDB.

The other option is that the queries are taking longer than the query timeout to run, are you checking for errors?

Finally - perhaps SDB is having a bad day and the query is just a bit slow - in those circumstances you can find you get 0 results but DO get a next token - and the actual results follow in the next batch.

Does any of that help?

0

精彩评论

暂无评论...
验证码 换一张
取 消