开发者社区 > PolarDB开源 > PolarDB 分布式版 > 正文

图中有关PolarDB的 pc-wz90aa8d1s3736keu相关问题是什么?

9bb73c80375fefa149b3bec6884b456e.png
7ec266c5ed48c697290cfa4f728f778f.png
SELECT id, customer_id AS customerId, sku_id AS skuIdFROM custom_goods_vendor_maintainingWHERE store_id = 900 AND valid = 1 AND id > 0 AND u_t < 1703667933563 AND custom_goods_vendor_maintaining.store_id = 900ORDER BY idLIMIT 200
图中有关PolarDB的 pc-wz90aa8d1s3736keu相关问题是什么?

展开
收起
小小爱吃香菜 2024-01-03 00:27:28 67 0
1 条回答
写回答
取消 提交回答
  • 加 hint: /+ SET_VAR(optimizer_switch="prefer_ordering_index=off,") / 就能解决,可以加 outline 来固定执行计划,我给您个语句。set character_set_client = 'utf8';
    call dbms_outln.add_optimizer_outline("vendor_manager", "/+ SET_VAR(optimizer_switch='prefer_ordering_index=off,') /", "explain SELECT id, customer_id AS customerId, sku_id AS skuId FROM custom_goods_vendor_maintaining WHERE store_id = 900 AND valid = 1 AND id > 0 AND u_t < 1703667933563 AND custom_goods_vendor_maintaining.store_id = 900 ORDER BY id LIMIT 200");

    set character_set_client = 'latin1';
    call dbms_outln.add_optimizer_outline("vendor_manager", "/+ SET_VAR(optimizer_switch='prefer_ordering_index=off,') /", "explain SELECT id, customer_id AS customerId, sku_id AS skuId FROM custom_goods_vendor_maintaining WHERE store_id = 900 AND valid = 1 AND id > 0 AND u_t < 1703667933563 AND custom_goods_vendor_maintaining.store_id = 900 ORDER BY id LIMIT 200"); 此回答整理自钉群“PolarDB 专家面对面 - 慢SQL索引选择优化器新特性”。

    2024-01-03 12:08:57
    赞同 展开评论 打赏

PolarDB 分布式版 (PolarDB for Xscale,简称“PolarDB-X”) 是阿里云自主设计研发的高性能云原生分布式数据库产品,为用户提供高吞吐、大存储、低延时、易扩展和超高可用的云时代数据库服务。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载