Questions tagged [partitioning]

Splitting a database table into multiple segments for performance or manageability.

Filter by
Sorted by
Tagged with
1
vote
1answer
64 views

Suboptimal query plan when updating partitioned table

Background I have a simple CTE used to update a declaratively-partitioned table. The subquery runs quickly (1.7sec per EXPLAIN ANALYZE) and returns 3,769 records (CTE y in the query below). The ...
0
votes
1answer
153 views

SQL Server Partition Switch

I have a partitioned table in SQL server 2017. I want to switch partition number 2 of this table the the staging table which is created using the same partition scheme as the original table. I'm ...
1
vote
0answers
55 views

Problem with partitioning non-clustered indexes

I have a database with partition function defined. Over this partition function there are 2 schemes defined, one for Data files and one for Indexes files. Data and index files are divided quaterly (...
0
votes
1answer
28 views

Oracle 11g, Will droping partition reuse free space on bigfile tablespace

I have four range partitioned tables which belongs to bigfile tablespace. Also local indexes on that tables belongs to other bigfile tablespace. My partitioning range is one day and I have stored ...
2
votes
1answer
54 views

How can I get the last items by date desc then by id desc?

I have a employee course table which holds the current record for each of my employees who have some courses that they have taken. Then I have a history that keeps a static version of the save data ...
0
votes
0answers
29 views

Where each partition has only one value in the constraint column, can I avoid filtering?

I have partitioned a table in postgres 9.6 by date. Every date within a parition is identical. When I select data, a relatively expensive Seq Scan filter operation happens against every row in the ...
0
votes
1answer
72 views

sliding window partitioning on date field

I need to apply Sliding Window Partitioning on a table that contains 1B of records. CREATE TABLE table_1( [Id] [bigint] IDENTITY(1,1) NOT NULL, [log_date] datetime NULL, [field1] [bigint] ...
2
votes
1answer
46 views

Network Partitioning

My current understanding of the network-partitioning scenario, also mentioned in the CAP theorem, is that it's a scenario where the clients are not able to connect to some DB nodes even though they ...
7
votes
2answers
229 views

Wrong estimate on a query on partitioned tables

I wonder why SQL Server makes wrong estimations in such a simple case. There is a scenario. CREATE PARTITION FUNCTION PF_Test (int) AS RANGE RIGHT FOR VALUES (20140801, 20140802, 20140803) CREATE ...
0
votes
1answer
19 views

mysql 5.5 repartition

With MySQL 5.5, I want to change the partitioning scheme of a very large InnoDB table from "hash" to "range". Can I do it while the table is accepting DML? If not, what is the best-practice work-...
0
votes
2answers
48 views

Is there a way to automatically update a view based on daily created tables?

Let's say I have a table that is created daily: 20181227 20181226 20181225 ... There is view that is like: CREATE OR REPLACE VIEW someview AS SELECT * FROM 20181227 UNION SELECT * FROM 20181226 ...
4
votes
1answer
618 views

PostgreSQL How to DEFAULT Partitioned Identity Column?

PostgreSQL 11 What is the best way to generate default values for identity columns on partition tables. E.g CREATE TABLE data.log ( id BIGINT GENERATED ALWAYS AS IDENTITY ...
0
votes
0answers
23 views

Mariadb / mysql table partitionning column usage

I read mariadb documention :https://mariadb.com/kb/en/library/partition-maintenance/ And it sayed : The partition field should not be the field first in any key But in mysql documentation :https:...
2
votes
1answer
570 views

MySQL when using WHERE BETWEEN, query hits all partitions

This is probably just me misunderstanding how MySQL partitions work, but I have a table defined with: `ID` int(11) NOT NULL, `target_id` int(11) NOT NULL, `created_at` datetime NOT NULL, ...
0
votes
1answer
160 views

Moving mysql database to new partition with different partition “type”

Sorry, Possibly a dumb question, but something which needs clarification. Currently mysql is stored on sda which is around 1TB. Now our DB has outgrown that, almost !!. So trying to create new ...
0
votes
1answer
168 views

Postgres 11 declarative partitioning by relative time

I'm working on a system that uses PostgreSQL 11 as it's main data store, and I'm looking at how to most efficiently query a large table of events (up to 120 million rows, so not 'big data' big, but ...
8
votes
1answer
2k views

TOP(1) BY GROUP of very huge (100,000,000+) table

Setup I have a huge table of ~115,382,254 rows. The table is relatively simple and logs application process operations. CREATE TABLE [data].[OperationData]( [SourceDeciveID] [bigint] NOT NULL, ...
1
vote
1answer
31 views

Does dropping a partition and running update indexes stop DML execution on the whole table?

I am looking to drop a partition from a table in the database. I wanted to know if I run ALTER TABLE DROP PARTITION UPDATE INDEX, would there be any blocking of DML statement executions on the other ...
2
votes
1answer
704 views

Moving the data between partitions in a table

There is one table with partition, where partition function and scheme is defined like below: CREATE PARTITION FUNCTION DateRangePF (CHAR(8)) AS RANGE RIGHT FOR VALUES ('20180101','20190101') ...
1
vote
1answer
280 views

Adding a CHECK constraint doesn't improve performance of ATTACH PARTITION on postgres table

I'm attempting to merge a table into a partition, the merge works but the performance isn't good. I've read this link, in particular this quote.... Before running the ATTACH PARTITION command, it ...
1
vote
2answers
1k views

How to identify the column used to partition a table from the Postgres system catalogs

Given a table created as so... CREATE TABLE measurement ( city_id int not null, logdate date not null, peaktemp int, unitsales int ) PARTITION BY RANGE (...
0
votes
2answers
259 views

With partitioned table, How can I use hints to group each partition separately

Suppose I have the following table data(partitioned_key_index, some_dummy_measure) Assume that partitions are of an equal large size. with Oracle 11g. The end result should be like this ...
1
vote
0answers
43 views

Filegroup per Table partition - remove filegroup and re-add filegroup

I've seaching all over the web for a solution, if it is even possible... I'm not a savvy in Partitioned tables in different filegroups... Our software is supported by SQL 2008 R2 SP2 to SQL 2017 for ...
1
vote
0answers
146 views

How to VACUUM FULL a single partition without stalling the parent?

I have a table called TABLE_A that's partitioned by month. Each partition is named according to it's month, TABLE_A_201810, TABLE_A_201811 etc I've noticed that if I attempt to VACUUM an old ...
0
votes
1answer
72 views

partition in ndbcluster

My environment will use 2-3 cluster nodes. The db schema at first was designed without knowing the limitation/rules with NDBCLUSTER on (BIG mistake! I know). Some things I notice and want to ...
0
votes
1answer
272 views

Partitioning an existing table into multiple filegroups [duplicate]

I am working on a SQL Server 2016 SP2 Standard edition server, with an in-house application that is 24/7 used in multiple locations across multiple countries. The current application has one database ...
2
votes
1answer
75 views

Is database partitioning only created to get a better performance? and why should one partition a table, and a database? [closed]

I was asked if SQL Server can handle huge databases ( for them a huge database is 100GB). I know it can. I worked with 4tB databases already. But I would like to ask, thinking about really huge ...
1
vote
1answer
404 views

Index rebuild at partition level on a table

We have functionality in SQL Server to rebuild indexes at partition level using below command ALTER INDEX IX_name ON table REBUILD PARTITION=68 In non-partitioned table we disable the indexes, load ...
6
votes
1answer
510 views

Rebuilding indexes for a partitioned table having 300 partitions

Scenario Partitioned table is empty and I am loading data for 1 partition which has 180k rows. I disabled the indexes and loaded the data and rebuilt the indexes after data is loaded. Issue While ...
2
votes
2answers
1k views

How to identify the ranges over which a postgres table was partitioned?

If I create a table and partitions like this... CREATE TABLE tab1 (a int, b int) PARTITION BY RANGE(a); CREATE TABLE tab1_p1 PARTITION OF tab1 FOR VALUES FROM (0) TO (100); CREATE TABLE tab1_p2 ...
1
vote
2answers
365 views

SQL To Fetch Partition Boundaries and Filegroups

For a given partition scheme name, I need to retrieve the set of Boundary Value FileGroup Name This must work without the existence of any tables participating in the scheme. i.e. joins via sys....
0
votes
1answer
328 views

Declarative partitioning with Postgres for integer column

I was reading this article: https://blog.timescale.com/scaling-partitioning-data-postgresql-10-explained-cd48a712a9a1 the article lifts information directly from here: https://www.postgresql.org/docs/...
2
votes
0answers
251 views

missing ibd files

I'm running mysql 5.6. For reasons entirely my own fault, I've got some missing ibd that make up partitions for several tables. When I try to mysql I get the following messages for the missing ...
0
votes
1answer
36 views

Switching out of one scheme into another

I have a table named dbo.messages. We are expecting a lot of data in this table. To keep things to a reasonable level we are looking at a weekly partitioning on that table. What I would like to do ...
0
votes
1answer
70 views

Optimizing SQL query with two table joins and over 40 million rows in partitioned table

I have three tables, lets say their names are: table1 (has total over 40 million rows, but is partitioned with Declarative partition https://www.postgresql.org/docs/10/static/ddl-partitioning.html ...
7
votes
2answers
333 views

How many partitions should I make for my clustered columnstore index tables? Should I partition the rowstore tables also?

I have a data warehouse comprised of four clustered columnstore index tables (CCI) and nine rowstore tables. These tables are used only for analytics and the CCI data is inserted from staging tables ...
1
vote
1answer
415 views

Select data with the latest table partition that actually holds data

Version: SQL Server 2016 So, I need to be able to select the data within the most recent table partition. I can do this by using the below script but the latest partition doesn't contain any data. ...
0
votes
1answer
62 views

SQL server - Re. Filegroup / partitioning

Assuming VLDB is split into multiple file groups, each having its own file and on a separate disk. Now let's say there is a disk crash bringing down one of the file groups - then will the other parts ...
0
votes
1answer
679 views

Counting using window function with partition over an empty table

If i have an empty table (created but without rows in it), and i would like to get the number 0 from the below query, how i could achieve that? select count(*) over (partition by field_name) from ...
1
vote
0answers
224 views

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

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 ...
1
vote
1answer
5k views

How do I add a partition to an existing table in mariadb / mysql?

I have the following table. I want to add partitions too. CREATE TABLE `app_log_Test` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `dateCreated` datetime NOT NULL, `host` varchar(512) COLLATE ...
1
vote
0answers
48 views

MySQL 5.7 issue with 16TB disk

(Repost from StackOverflow) I have a MySQL 5.7 running on a Windows Server 2016 VM with two disks from a NAS: C:\ for system and D:\ for data (empty at start). I try to create a partitioned table: ...
2
votes
1answer
220 views

Question on best practice - keep empty partitions at both ends of your table?

I was reading ALTER PARTITION FUNCTION best practices which says - Always keep empty partitions at both ends of the partition range to guarantee that the partition split (before loading new data) ...
0
votes
1answer
505 views

Create Range Partition on existing large MySQL table

I have inherited a database that contains a large table (relative to the rest of the database - 10 million plus rows) of auditing data that needs to be retained for 60 days. Anything older than 60 ...
0
votes
1answer
136 views

Internal error code, kksgaItLvl_Setup [closed]

A simple query fails with the error. Has anyone faced this issue or has any solutions? SELECT MAX(some_value) FROM some_table WHERE some_id = 62328188199 AND some_name = '...
1
vote
1answer
73 views

Log shipping from SQL Server 2014 Enterprise db to SQL Server 2017 Standard with partitioning

I wish to implement log shipping from my current primary which is a SQL Server 2014 Enterprise database to a SQL Server 2017 Standard edition database. I also wish to implement table partitioning on ...
0
votes
1answer
925 views

mongodb - monthly archival of data

Coming from a RDBMS background, this is what I have done in the past. Create a table with partitions based on a date field. There are typically three tables (partitions) - current (M0), previous ...
1
vote
1answer
1k views

Is Postgres sharding available on Aurora (AWS)

I need to shard and/or partition my largeish Postgres db tables. The Postgres partitioning functionality seems crazy heavyweight (in terms of DDL). I see talk from <=2015 about pg_shard, but am ...
1
vote
3answers
310 views

Partial local index on partitioned Oracle table

We have a big transactional table, partitioned on transaction date (day). Each day, several million records are added. We need to do selects on this table, over a period of the last five days, and ...
1
vote
1answer
128 views

MySQL Partitioning based on addition

I cannot find a good keyword to search for this kind of question, so here you go: Suppose i have this table: CREATE TABLE test ( tr_uuid BINARY(16) NOT NULL, Customer VARCHAR(10) NOT NULL, Data ...

1 2 3 4 5 16