Questions tagged [table-partitioning]

47 questions
0
votes
1 answer

PostgreSQL unique constraint on partitioned table must include all partitioning columns

I want to create a partitioned table in the PostgreSQL database and run the below query. CREATE TABLE tracking_trackingdata ( "id" uuid NOT NULL, tracking_id varchar(100) NOT NULL…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

what happens to partitioned local indexes after a table partition is dropped oracle

I have a requirement to drop multiple partitions for a table every month. The table has been partitioned based on the year and month and has partitioned local indexes 1.since the indexes are local ,I believe they get dropped with the partition and…
0
votes
1 answer

Main table update call trigger on partition

I have a table let's call it movie that is partitioned by genre. I have a trigger defined on one of the partitions as follows: create trigger refresh after insert or update or delete on movie_comedy for each statement execute procedure…
kylie.zoltan
  • 377
  • 3
  • 15
0
votes
0 answers

Calculating Percentile on large SQL tables

I have a large SQL table with 100+ million records in SQL Server as follows: +-----------+----------+----------+----------+----------+ |CustomerID |TransDate |Category | Num_Trans |Sum_Trans…
0
votes
1 answer

Postgresql Sqlalchemy dynamic table partition creation issue

I'm using postgresql and python sqllachmey for creating the partitioned table. Below is the example code. from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.types import Text Base = declarative_base() class Students(Base): …
Loki
  • 5
  • 2
0
votes
2 answers

I want to divide a table into two half such that the number of rows and sum of amount column is similar

For example please find the below data: account balance 9999 110 9998 111 9997 112 9996 113 9995 114 9994 115 9993 116 9992 117 9991 118 9990 119 The output should be in such a way that there are 5 rows in Table_A and…
0
votes
1 answer

SQL Server Partitioning on a table that could update data in older partitions

So, I have a table that typically has around 300-500K rows being inserted in to it within a 24 hour time period. Data is also continuously queried from this table. There is an Intime column that holds the date+time that the data is inserted. The…
Chetan
  • 443
  • 4
  • 8
0
votes
0 answers

Partition tables getting locked due to a process which supports XA protocol

Upon starting our system server, the tables which are having partitions upon them(Range paritioning in postgres) are getting locked(in a way that SELECT query is still fetching output from them) but there are some ALTER statements which are getting…
0
votes
1 answer

truncate partitions with foreign keys without cascade in postgresql

I have a schema like this: create table thing ( section uuid not null, thing_id uuid not null, alias_of uuid default null, constraint alias_ref foreign key (section, alias_of) references thing (section, thing_id), …
scravy
  • 11,904
  • 14
  • 72
  • 127
0
votes
1 answer

How to get value list of list partitioning table of postgresql?

I am trying to use list partitioning in PostgreSQL. https://www.postgresql.org/docs/current/ddl-partitioning.html So, I have some questions about that. Is there a limit on the number of values or partition tables in list partitioning? When a…
Jmob
  • 49
  • 7
0
votes
1 answer

Advice on changing the partition field for dynamic BigQuery tables

I am dealing with the following issue: I have a number of tables imported into BigQuery from an external source via AirByte with _airbyte_emitted_at as the default setting for partition field. As this default choice for a partition field is not very…
ΑΘΩ
  • 101
  • 1
0
votes
0 answers

Is there a recommended table size for partitioning in postgresql?

I used RDS Aurora PostreSQL in AWS. The size of the data I manage and the number of rows are too large (7 billion rows and 4TB), so I am considering table partitioning. (I also considered the citus of postgresql... but unfortunately it is not…
Jmob
  • 49
  • 7
0
votes
1 answer

Add serial column to a partitioned table in postgres

We have a table which is partitioned, we now want to add a serial id column to the table. Do we need to explicitly add the id column to all the portioned tables or we just need to add the column to the master table. Any help in this would be really…
opensource-developer
  • 2,826
  • 4
  • 38
  • 88
0
votes
1 answer

Partitioning existing table doesn't work, why?

I need help with portioning existing table in the Database. I'm using MSSQL server 2017 and I have table called ACD stores data about calls received and it contains hundred of thousands of records and it is expected to have millions later by the end…
Moe Kronz
  • 31
  • 5
0
votes
0 answers

Postgresql - Optimize ordering of columns in table range partitioning with multiple columns range

I am testing with creating a data warehouse for a relatively big dataset. Based on ~10% sample of the data I decided to partition some tables that are expected to exceed memory which currently 16GB Based on the recommendation in postgreSQL docs:…