Re: Slow response to my query - Mailing list pgsql-novice

From Bzzzz
Subject Re: Slow response to my query
Date
Msg-id 20191129181315.471081a2@msi.defcon1.lan
Whole thread Raw
In response to Re: Slow response to my query  (Goke Aruna <goksie@gmail.com>)
Responses Re: Slow response to my query
List pgsql-novice
On Fri, 29 Nov 2019 17:35:03 +0100
Goke Aruna <goksie@gmail.com> wrote:

> are you debit or IOPS bounded,
>      IOPS

Then prefer 1|10, others are bounded to the R/W speed of only the
slowest disk while 1|10 is distributed among 1/2 disk Nb, so faster for
reads.
NB: This is less true with ZFS as other factors are at work.

Note that if you plan to use ZFS, extending an array of disks will mean
most of new writings will happen only onto the new disks until they reach
the same filling level than others - often crucial whatever the RAIDZ
level is.

Also do not forget about backupS!

> how fast is your DB growing,
>      Like 1.5GB per hour

Hmm, this lead to a bit more than 1TB/month30d, you'll either need more
SSDz or larger.

This is here that you can see carriers' names in the plain is
eating too place for nothing: one regular INTEGER (int4) = 4 bytes
(used as a foreign key) or even less if you do not have a lot of
carriers and the y fit into 32,768 (small int), when each character is
_at least_ one byte and often more in UTF8.

Also, the link I supplied you with (the one w/ rock and sand) is about
aligning row according to Pg internal constraints (in terms of memory) -
as it is said in this article, you could quite easily reach -20% on table
place taken on disk - this is almost a nonsense for any small app, but
with your number of rows, this becomes almost mandatory to scan faster at
a lower cost with less than an hour of tests/calculations to reorder
columns in your main table.

> how many simultaneous accesses you have/need,
>      Application - 5 and probably additional 5 for operator.

Ok almost nothing, connections speaking, but with a big debit each.

> what is the distribution between reads & writes,
>         70 read while 30 writ
> what is the alignement & size of one row,
>       Most used table has 42 columns while next after it has 18 columns

No, see above about what kind of alignment it is.

> etc.
>
> After that,
> which stripe size, 32

I do not use RAID anymore (and used it only in software version), so I do
not know if it is a good size taking in account the Pg page size (8kB),
the SSD sector (normally 2kB) and the clustering (min size of a
logical sector.)

JY



pgsql-novice by date:

Previous
From: Goke Aruna
Date:
Subject: Re: Slow response to my query
Next
From: Goke Aruna
Date:
Subject: Re: Slow response to my query