Re: Need help in logical replication

2025-01-13 Thread Divyansh Gupta JNsThMAudy
criber table empty?? > > Thank you, > > On Mon, Jan 13, 2025 at 7:30 AM Divyansh Gupta JNsThMAudy < > ag1567...@gmail.com> wrote: > >> Hii PostgreSQL Community, >> >> I am setting up logical replication between two clusters in the same >> subnet g

Need help in logical replication

2025-01-13 Thread Divyansh Gupta JNsThMAudy
Hii PostgreSQL Community, I am setting up logical replication between two clusters in the same subnet group. I’ve created a publication on the primary and a subscription on the secondary, and the replication slot has been created. However, the slot remains inactive, and changes aren’t being applie

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
not in a DB specialised on JSON like MongoDB? > > Divyansh Gupta JNsThMAudy escribió: > > Thank you everyone for giving your valuable responses, I am glad that > everyone understands my concern. I got some good ideas about the database > design that I am following after going throu

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
() NOT NULL, > onupdateat timestamp(6) DEFAULT clock_timestamp() NOT NULL, > startsnapshot int4 DEFAULT 0 NOT NULL, > currentsnapshot int4 DEFAULT 0 NOT NULL, > dismiss int2 DEFAULT 0 NOT NULL, > checksum varchar NULL, > typeoffile int2 GENERATED ALWAYS AS ( > > > > On Mon, D

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
Currently I haven't created those columns , I have created addons_json column which is a JSONB column yet in a discussion weather I should create or consider only one JSONB column. On Tue, 24 Dec 2024, 12:00 am Divyansh Gupta JNsThMAudy, < ag1567...@gmail.com> wrote: > Range part

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
on Johnson, wrote: > > 1. I bet you'd get better performance using RANGE partitioning. > 2. Twenty million rows per userid is a *LOT*. No subdivisions (like date > range)? > > On Mon, Dec 23, 2024 at 1:23 PM Divyansh Gupta JNsThMAudy < > ag1567...@gmail.com>

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
acter varying)::text)) STORED NULL, isfileencrypted int4 DEFAULT 0 NULL, addons_json jsonb DEFAULT '{}'::jsonb NULL, CONSTRAINT googledocs_tbl_clone_pkey PRIMARY KEY (gdid, userid), CONSTRAINT fk_googledocs_tbl_clone_users_tbl FOREIGN KEY (userid) REFERENCES dbo.users_tbl(uid) ON DELETE CASCADE ) P

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
(modulus 84, remainder 83); On Mon, Dec 23, 2024 at 11:48 PM Divyansh Gupta JNsThMAudy < ag1567...@gmail.com> wrote: > Adrian, the partition is on userid using hash partition with 84 partitions > > Ron, there could be more than 20 Million records possible for a single > userid in tha

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
Dec 2024, 11:40 pm Ron Johnson, wrote: > If your queries all reference userid, then you only need indices on gdid > and userid. > > On Mon, Dec 23, 2024 at 12:49 PM Divyansh Gupta JNsThMAudy < > ag1567...@gmail.com> wrote: > >> I have one confusion with this design i

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
ote, I'd stick with 50 separate t* columns. > Simplifies queries, simplifies updates, and eliminates JSONB conversions. > > On Mon, Dec 23, 2024 at 12:29 PM Divyansh Gupta JNsThMAudy < > ag1567...@gmail.com> wrote: > >> Values can be updated based on customer actions &

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
Empty JSONB by mistake, I wrote array sorry about that On Mon, 23 Dec 2024, 10:59 pm Divyansh Gupta JNsThMAudy, < ag1567...@gmail.com> wrote: > Values can be updated based on customer actions > > All rows won't have all 50 key value pairs always if I make those keys > into

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
8 and ((addons_json @> {t1:1}) or (addons_json @> > {t1:2}) or (addons_json @> {t1:3}) > more key filters if customer applies > > > > On Mon, Dec 23, 2024 at 10:38 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> >> >> On Mon

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
On Mon, Dec 23, 2024 at 10:38 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > > On Mon, Dec 23, 2024, 10:01 Divyansh Gupta JNsThMAudy > wrote: > >> >> So here my question is considering one JSONB column is perfect or >> considering 50 columns

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
Each row have a PK (gdid) that will uniquely refrence 50 k/v pair set On Mon, 23 Dec 2024, 10:35 pm Ron Johnson, wrote: > How do you uniquely reference each set of 50 k/v pairs? > > On Mon, Dec 23, 2024 at 12:01 PM Divyansh Gupta JNsThMAudy < > ag1567...@gmail.com> wrot

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
.. So on So here my question is considering one JSONB column is perfect or considering 50 columns will be more optimised. On Mon, 23 Dec 2024, 10:24 pm Adrian Klaver, wrote: > On 12/23/24 08:46, Divyansh Gupta JNsThMAudy wrote: > > Also as you ask how 50 pairs turns into 50 colum

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
Also as you ask how 50 pairs turns into 50 column so each column will be a key and the value of that key will store inside their respective column for each row On Mon, 23 Dec 2024, 10:14 pm Divyansh Gupta JNsThMAudy, < ag1567...@gmail.com> wrote: > As per the discussion with other tea

Re: Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
after applying a GIN index on that however the statement sounds funny but I want to take everyone openion? On Mon, 23 Dec 2024, 10:05 pm Adrian Klaver, wrote: > On 12/23/24 07:53, Divyansh Gupta JNsThMAudy wrote: > > Hii Community, > > > > I need to provide a support for s

Need help in database design

2024-12-23 Thread Divyansh Gupta JNsThMAudy
Hii Community, I need to provide a support for some functionality for my application for that I need to store 50 key value pair set, so I am in a dilemma, weather I create 50 new columns of int2 data type each column will contain value of a specific key or should I go with JSONB data type with 50