在Oracle中查找记录的索引分区方式。

huangapple go评论56阅读模式
英文:

Howto find index partition of a record in oracle

问题

在Oracle中是否可能找到记录的索引分区?即,记录属于哪个索引分区?

我将提供所需的翻译,不会包含其他内容。

英文:

Is it possible to find the index partition of a record in oracle. ie., to which index partition a record belongs to?

答案1

得分: 2

是的,可以通过以下方式查询:

select p.partition_name, c.column_name, p.high_value
  from user_part_key_columns c
  join user_tab_partitions p on p.table_name = c.name
 where p.table_name = upper('&MyTable'); -- 你的表名在这里填写

然后通过以下方式查找你的表:

```sql
select *
  from MyTable
 where id = MyID
   and MyKeyColumn < MyHighValue; -- 考虑最不满意的值

其中,`MyKeyColumn` 对应于 `c.column_name``MyHighValue` 对应于 `p.high_value`,例如,可以通过双重检查比较来得出这些值。

<details>
<summary>英文:</summary>

Yes, it&#39;s possible by querying

    select p.partition_name, c.column_name, p.high_value
      from user_part_key_columns c
      join user_tab_partitions p on p.table_name = c.name
     where p.table_name = upper(&#39;&amp;MyTable&#39;); -- your table name comes here

and then looking up your table by 

    select *
      from MyTable
     where id = MyID
       and MyKeyColumn &lt; MyHighValue; -- consider the least satisfying value

where `MyKeyColumn` is counterpart for `c.column_name` and `MyHighValue` is counterpart for `p.high_value`, e.g. those can be derived by double-check comparison. 


</details>



huangapple
  • 本文由 发表于 2020年1月6日 18:47:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/59610708.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定