2013-10-08 19:11
浏览 37

PHP Azure表存储+超时

I am using PHP to retrieve all rows from partition(s). I am using the below method to get all rows

Facing a unique issue: If i am using one partition result is returned, using more than one partition with OR Clause returns no results.

Seems like to me two issues:

  1. Partition with OR Condition and Filter on other column causing something turn mental.

  2. There is issue with the PHP SDK ( Version 2.0 )

Any help will be highly appreciated,

  1. Queries have a Partition column properly used. e,g if I am running this query ( 10 rows against two partitions)

    ( cid eq '18831') and ( (PartitionKey eq '2013100606') or (PartitionKey eq '2013100607') )

    There is no response when partitionkey have more than one values with OR Clause using PHP script. Using storage explorer application Seems like it take more than 5 seconds for 10 rows to pull from two partitions. ( All i have is 10 rows no other data in both partitions)

If I access only one Partition it returns the rows.

( cid eq '18831') and ( (PartitionKey eq '2013100607') )  // Works fine

There are 10 rows in each partition, if i access single partition value it works fine.

Also please note I am using expect100Continue and Nagle turned off.

      <servicePointManager expect100Continue="false" useNagleAlgorithm="false"/> 
      <add address = "*" maxconnection = "48" /> 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongque1462 2013-10-09 08:30

    Based on the blog post by Windows Azure Storage team - How to get most out of Windows Azure Tables (scroll down to Queries section in the post, point #4), queries involving OR are not optimized and would result in full table scan. You may be running into issues because of that.

    You may want to change your query to avoid this situation. A few things you could try are:

    ((PartitionKey ge '2013100606') and (PartitionKey le '2013100607')) and (cid eq '18831')
    (PartitionKey eq '2013100606' and cid eq '18831') or (PartitionKey eq '2013100607' and cid eq '18831')

    See if doing any of these help. Instead of 2nd query, you could fire two separate queries in parallel.

    解决 无用
    打赏 举报

相关推荐 更多相似问题