问题描述
我知道在 DB2
中的分区是如何工作的,但是我不知道这个分区值在哪里被完全存储。在创建分区查询后,例如:
I know how partitioning in DB2
works but I am unaware about where this partition values exactly get stored. After writing a create partition query, for example:
CREATE TABLE orders(id INT, shipdate DATE, …)
PARTITION BY RANGE(shipdate)
(
STARTING '1/1/2006' ENDING '12/31/2006'
EVERY 3 MONTHS
)
在运行上述查询后,我们知道分区是按照3个月的顺序创建的,但是当我们运行select查询时查询引擎这个分区。我很好奇知道在哪里存储,无论是在同一个表中,还是DB2都有一个不同的表,每个表的分区值被存储。
after running the above query we know that partitions are created on order for every 3 month but when we run a select query the query engine refers this partitions. I am curious to know where this actually get stored, whether in the same table or DB2 has a different table where partition value for every table get stored.
谢谢,
推荐答案
经过一番研究,出来,并希望与他人分享这些信息,希望对他人来说可能会有用。
After a bit of research I finally figure it out and want to share this information with others, I hope it may come useful to others.
如何看到这个键值? =>对于LUW(Linux / Unix / Windows),您可以看到表对象编辑器或对象查看器脚本选项卡中的键。对于z / OS,有一个名为限制密钥的对象查看器选项卡。我打开问题TDB-885为LUW表创建一个对象查看器选项卡。
How to see this key values ? => For LUW (Linux/Unix/Windows) you can see the keys in the Table Object Editor or the Object Viewer Script tab. For z/OS there is an Object Viewer tab called "Limit Keys". I've opened issue TDB-885 to create an Object Viewer tab for LUW tables.
一个简单的查询来检查这个值:
A simple query to check this values:
SELECT * FROM SYSCAT.DATAPARTITIONS
SELECT * FROM SYSCAT.DATAPARTITIONS
WHERE TABSCHEMA =? AND TABNAME =?
WHERE TABSCHEMA = ? AND TABNAME = ?
ORDER BY SEQNO
ORDER BY SEQNO
参考:
这篇关于DB2分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!