英文:
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'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('&MyTable'); -- your table name comes here
and then looking up your table by
select *
from MyTable
where id = MyID
and MyKeyColumn < 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>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论