V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
soap0X
V2EX  ›  数据库

咨询 ORACLE 主键索引的问题?

  •  
  •   soap0X · Feb 17, 2025 · 1291 views
    This topic created in 433 days ago, the information mentioned may be changed or developed.

    数据库:oracle

    情况说明:表 a 主键 bill_no varchar2 类型; 条件主键 加引号 走索引,不加不走,为什么?

    查 selec a.1 from a where a.bill_no=123 不走索引
    
        selec a.1 from a where a.bill_no='123' 走索引
    
    2 replies    2025-02-17 19:47:52 +08:00
    coder01
        1
    coder01  
       Feb 17, 2025
    bill_no 是 varchar2 类型,隐式转换会导致索引失效
    soap0X
        2
    soap0X  
    OP
       Feb 17, 2025 via Android
    @coder01 👌
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5628 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 85ms · UTC 08:52 · PVG 16:52 · LAX 01:52 · JFK 04:52
    ♥ Do have faith in what you're doing.