database-partitioning

mySQL partitioning multi-file vs. one-file performance?

陌路散爱 提交于 2020-01-01 12:33:08
问题 When partitioning a large table, I have a choice to set the flag -innodb_file_per_table to TRUE or FALSE. True will create many files (one per partition) and greatly increase my disk usage, but allows me to spread partitions on different volumes (which I do not plan to do). FALSE will keep the table as one big file. Assuming I keep all files on the same logical volume, can I expect any significant query performance difference between the two options? Or, more generally, are there any issues

How to implement table partitioning in Android (SQLite)?

独自空忆成欢 提交于 2019-12-25 04:42:41
问题 As I know, SQLite does not support table partitioning. However, when an application deals with big data, I think table partitioning is a good consideration. Unfortunately I can't find an example implementation to do this in Android until now. The condition would be as follows. The table will grow over time Old rows are rarely queried/updated; typical operation will be, but not limited to, searching or exporting/backing up to a file Old rows are frequently queried for such a summary (e.g. by

Does partitioning in mysql create tables or merely virtual tables?

浪子不回头ぞ 提交于 2019-12-25 03:47:05
问题 When a partition is done in mysql , does it create tables or does it create virtual tables (i.e. views) which are pretty much stored queries accessed by a table name? Here is an example (although in Oracle, this is just used as an example - I am most curious about how it is handled in mysql) from http://www.devarticles.com/c/a/Oracle/Partitioning-in-Oracle/1/: CREATE TABLE SAMPLE_ORDERS (ORDER_NUMBER NUMBER, ORDER_DATE DATE, CUST_NUM NUMBER, TOTAL_PRICE NUMBER, TOTAL_TAX NUMBER, TOTAL

Getting unexpected result with Range Partitioning in MySQL

别等时光非礼了梦想. 提交于 2019-12-25 03:35:19
问题 I'm trying to partitioning using Range for all days in 2014 PARTITION BY RANGE(UNIX_TIMESTAMP(gps_time)) ( PARTITION p01 VALUES LESS THAN (UNIX_TIMESTAMP('2014-01-01 00:00:00')), . . . PARTITION p365 VALUES LESS THAN (UNIX_TIMESTAMP('2015-01-01 00:00:00'))); If I insert few lesser rows It's partitioning as expected. sitting in particular partition and that's fine. But when I try to insert thousands of rows at a time, for instance values which supposed to sit on 2014-07-07 00:00:00 placing at

Handling backups of a large table (>1 TB) in Postgres?

瘦欲@ 提交于 2019-12-25 03:19:08
问题 I have a 1TB table (X) that is a pain to backup. The table X contains historical log data that is not often updated after creation. We usually only access a single row at a time, so performance is still very good. We currently make nightly full logical backups, and exclude X for the sake of backup time and space. We do not need historical backups of X, since the log files from which it is populated are backed up themselves. However, recovery of X by re-processing of the log files would take

Handling backups of a large table (>1 TB) in Postgres?

杀马特。学长 韩版系。学妹 提交于 2019-12-25 03:19:03
问题 I have a 1TB table (X) that is a pain to backup. The table X contains historical log data that is not often updated after creation. We usually only access a single row at a time, so performance is still very good. We currently make nightly full logical backups, and exclude X for the sake of backup time and space. We do not need historical backups of X, since the log files from which it is populated are backed up themselves. However, recovery of X by re-processing of the log files would take

Change model's table name runtime

那年仲夏 提交于 2019-12-24 06:35:06
问题 I am using Sequelize.js and need to save historical data till specific year and want to separate my tables by year's prefix for example prices_2010, prices_2011 e.g. I can create so tableName:"company_historical_" + new Date().getFullYear(); for current years table and it will use this name for table, but what if I want to store or query data of 2015 year and want to use models instead of raw queries. So how can I change table of use runtime. something like changeTable() method sequelize. 回答1

Implementing history of PostgreSQL table

孤街浪徒 提交于 2019-12-23 13:13:33
问题 I want to implement history of changes of PostgreSQL table. The table is defined the following way: CREATE TABLE "ps_counters" ( "psid" integer NOT NULL, "counter" bigint[] NOT NULL ); I want the history table to look like: CREATE TABLE "ps_counters_history" ( "timestamp" timestamp NOT NULL, "psid" integer NOT NULL, "counter" bigint[] NOT NULL ); I need a trigger and a stored procedure which on every change (insertion or update) in ps_couneters to insert in ps_counters_history , but in

In Azure Cosmos DB, can we change partition key later on once we decided at the beginning

梦想的初衷 提交于 2019-12-23 07:27:42
问题 I am new to Cosmos DB and I noticed that we can set the partition key based on needs to scale effectively through code like this: DocumentCollection myCollection = new DocumentCollection(); myCollection.Id = "coll"; myCollection.PartitionKey.Paths.Add("/deviceId"); Question is can we change the partition key later on after we created the collection and specified the partition key? As I may find out that the choice of partition key is not proper later. 回答1: Changing the partition key is not

Oracle : Drop multiple partitions

假如想象 提交于 2019-12-22 13:58:29
问题 A table TMP has 5 partitions, namely P_1, P_2,....P_5. I need to drop some partitions of TMP ; the partitions to drop are derived by another query. Ex: ALTER TABLE TMP DROP PARTITIONS (SELECT ... From ... //expression to get partition names ) Let's say the SELECT statement returns P_1 & P_5. The part query of the ALTER statement above doesn't work. Is there any way to drop partitions with input from a SELECT statement? 回答1: You can use dynamic sql in anonymous pl/sql block; Begin for i in