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相关问题是什么?
加 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索引选择优化器新特性”。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
PolarDB 分布式版 (PolarDB for Xscale,简称“PolarDB-X”) 是阿里云自主设计研发的高性能云原生分布式数据库产品,为用户提供高吞吐、大存储、低延时、易扩展和超高可用的云时代数据库服务。