database-partitioning

How to partition a MySQL table based on char column?

坚强是说给别人听的谎言 提交于 2020-01-22 12:15:08
问题 Is it possible to partition based on char column? After reviewing the MySQL 5.1 documentation it appears that only integer types can be used. Is this correct? Or can I use some function to convert the char into an integer? The char field in question contains a unique identifier. 回答1: Partitioning in MySQL 5.1 can only deal with integer columns (Source). You can only use a few partitioning functions on non-integer columns. For example: CREATE TABLE ti (id INT, amount DECIMAL(7,2), tr_date DATE

PSQL - Select size of tables for both partitioned and normal

帅比萌擦擦* 提交于 2020-01-17 04:54:51
问题 Thanks in advance for any help with this, it is highly appreciated. So, basically, I have a Greenplum database and I am wanting to select the table size for the top 10 largest tables. This isn't a problem using the below: select sotaidschemaname schema_name ,sotaidtablename table_name ,pg_size_pretty(sotaidtablesize) table_size from gp_toolkit.gp_size_of_table_and_indexes_disk order by 3 desc limit 10 ; However I have several partitioned tables in my database and these show up with the above

Exclude values from oracle partition

喜欢而已 提交于 2020-01-17 03:29:27
问题 I want to use a Composite Range-List Partitioning in oracle. Using a range is pretty clear to me. The tricky part is on the list partition and this is where i have the question. Let's assume we have a column with continents. I want the list partition that to include all the continents that are NOT Europe. The problem here is that i cannot create a list partition including all other continents except of Europe, as at some point i might add new continents. Is something like this possible? 回答1:

Oracle 12.2 - Replacement of NOPARTITION feature

两盒软妹~` 提交于 2020-01-14 22:54:32
问题 I have Oracle version 12.2.0.1.0 We have generic script which create sequence that need to be reuse for different objects (by renaming sequence name): CREATE SEQUENCE NAME_SEQ MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 100 CACHE 200 NOORDER NOCYCLE NOPARTITION ; This script isn't working with below error until I remove NOPARTITION : ORA-00933: SQL command not properly ended I found in AskTom that the NOPARTITION is not supported in 12.2 there's been various of things in previous

Select from several partitions at once

孤人 提交于 2020-01-11 04:01:13
问题 Excuse me for my english. I have 2 tables, both partitioned by date interval, but on different fields. There is a big amount of records in both tables(~100kk in each partition). First table keep it's 3 last(by date) partitions in fast discks tablespace, others partitions is in slow discks tablespace. Also I have some system, which processing data. It execute processes in parallel, each one get data from first table by select statement and put processed data into second table. So I need select

Partitioning a database table in MySQL

江枫思渺然 提交于 2020-01-11 03:41:25
问题 I am writing a data warehouse, using MySQL as the back-end. I need to partition a table based on two integer IDs and a name string. A more concrete example would be to assume that I am storing data about a school. I want to partition the school_data table based on COMPOSITE 'Key' based on the following: school id (integer) course_id (integer) student_surname (string) For the student surname, it is just the first character of the surname that determines which 'partitioned table' the data

PostgreSQL+table partitioning: inefficient max() and min()

≯℡__Kan透↙ 提交于 2020-01-07 07:27:12
问题 I have a huge partitioned table stored at a PostgreSQL table. Each child table has an index and a check constraint on its id, e.g. (irrelevant deatils removed for clarity): Master table: points Column | Type | Modifiers ---------------+-----------------------------+------------------------ id | bigint | creation_time | timestamp without time zone | the_geom | geometry | Sub-table points_01 Column | Type | Modifiers ---------------+-----------------------------+------------------------- id |

Partitions and High Water Mark in Oracle

蹲街弑〆低调 提交于 2020-01-04 03:43:16
问题 High Water Mark (HWM) for a table in an Oracle Database is the line between blocks that have been used and ones that have never been. Truncating a table resets the HWM to zero. Now, if I have a partitioned table, I'd like to know if the following is true: Does each partition maintain its own HWM? If not, does alter table ... drop partition ... affect table's HWM? The idea is I'd like to populate partition's tables with insert /*+ append */ (direct path insert), but it only writes data beyond

Partitions and High Water Mark in Oracle

ぐ巨炮叔叔 提交于 2020-01-04 03:41:55
问题 High Water Mark (HWM) for a table in an Oracle Database is the line between blocks that have been used and ones that have never been. Truncating a table resets the HWM to zero. Now, if I have a partitioned table, I'd like to know if the following is true: Does each partition maintain its own HWM? If not, does alter table ... drop partition ... affect table's HWM? The idea is I'd like to populate partition's tables with insert /*+ append */ (direct path insert), but it only writes data beyond

How to migrate an existing Postgres Table to partitioned table as transparently as possible?

百般思念 提交于 2020-01-02 03:57:05
问题 I have an existing table in a postgres-DB. For the sake of demonstration, this is how it looks like: create table myTable( forDate date not null, key2 int not null, value int not null, primary key (forDate, key2) ); insert into myTable (forDate, key2, value) values ('2000-01-01', 1, 1), ('2000-01-01', 2, 1), ('2000-01-15', 1, 3), ('2000-03-02', 1, 19), ('2000-03-30', 15, 8), ('2011-12-15', 1, 11); However in contrast to these few values, myTable is actually HUGE and it is growing continuously