dongwei3151 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

http://www.windowsazure.com/en-us/develop/php/how-to-guides/table-service/#RetEntitiesInPartition

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"/> 
    </settings> 
<connectionManagement> 
      <add address = "*" maxconnection = "48" /> 
    </connectionManagement>
  • 写回答

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码