Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXR6t-0000MF-7G for pgsql-general@arkaria.postgresql.org; Mon, 04 Oct 2021 16:46:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mXR6r-0006ci-6l for pgsql-general@arkaria.postgresql.org; Mon, 04 Oct 2021 16:46:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXR6q-0006ca-Lp for pgsql-general@lists.postgresql.org; Mon, 04 Oct 2021 16:46:36 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mXR6o-0001FT-EA for pgsql-general@postgresql.org; Mon, 04 Oct 2021 16:46:35 +0000 Received: by mail-il1-x12d.google.com with SMTP id y17so10656714ilb.9 for ; Mon, 04 Oct 2021 09:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yr7rX772ZUoIHNFSKbuyAFzCiYE8wfN3Bxo1gJxB6LM=; b=XPfcXozNJLVfbhwupw7i5lhjqZqYL+Rkvl1KJz0DEggnFFlT1TpQn0BVcLiIJ4c1XW tISaQ1k1/cZoVEXB/haSpdLx2CjAeBXle9ggsMlwgA8zdN+0pePrq8ljQ5j7DCkhsVL5 52YfbDpKAm23D3X9UO7abchz2GbYMiF9i4ky+cnwIuWLEDW4GCU4aMULVJzWEwfr67Gu vM3d+AcZTz5R+6aCpotlZDyv26v8JQtVNk2v3Bjux+mn30x0xH/hj/bGbTOyfOPnRk6f NFewCGJ4j2X6tqvhyjrxPB2P+N8iDznUi8GXHcI6BXtVMkwfd7KESiyi5Ixonrvl119y sjSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=yr7rX772ZUoIHNFSKbuyAFzCiYE8wfN3Bxo1gJxB6LM=; b=TTaIHLH/U/akx7nwAKz0EmsSSB6OKRZdlpYqfxWMvOPK+c+Tkq1qJuplpI3GLPDCc3 KZFbrmooRCeFu6+7xllQ92oOdFGtQJIfQz2QdQjl4IKbRl+vo0j30OJCY7lhbg0+NgSx KM3eT5E6V4+n84a9tReN3O8ajAgsFQMEFcz/YGlr3IDSXiUytoPMhfULYMzvJo3udMb4 2f5LS3W7NY4NepZAO9LENtbYNmqa24lxWlJV5t+Kej4GCEkP32zvsKqzjmlArBkpQdQA HazTSrujbM9ag4U2SzjMIiJUxcIrjOYCMRa+UVV8kIPvPRlnxtdcJyAqx4wzudi5PBvD vmSw== X-Gm-Message-State: AOAM531/kuPJ8Qv5Q7t57AFOaDaT2MsO/Lnwa0J6trXBuNA+2NEDVdjb qoW3dbOmwkymZRjEL5t+Qvk= X-Google-Smtp-Source: ABdhPJwt36WbpHmN8xQKDFO1JjYaUGucKi5qrq0RthPCSRGiQxWa4yWENOVCIZwt+UI2U3KAKmFQHA== X-Received: by 2002:a05:6e02:16c8:: with SMTP id 8mr10203813ilx.250.1633365993197; Mon, 04 Oct 2021 09:46:33 -0700 (PDT) Received: from smtpclient.apple ([2601:681:5500:dde0:ed94:cc53:bb45:5a54]) by smtp.gmail.com with ESMTPSA id v13sm1184034ilj.43.2021.10.04.09.46.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Oct 2021 09:46:32 -0700 (PDT) From: Rob Sargent Message-Id: <39A75BC4-7F4D-45F9-BD66-891F0294A072@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_3B59198A-43ED-4EA9-AA50-7B103C6233E1" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Growth planning Date: Mon, 4 Oct 2021 10:46:31 -0600 In-Reply-To: <35170FC5-0A05-48F3-9ED1-F007CC1AF365@alaska.edu> Cc: "pgsql-general@postgresql.org" To: Israel Brewster References: <35170FC5-0A05-48F3-9ED1-F007CC1AF365@alaska.edu> X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_3B59198A-43ED-4EA9-AA50-7B103C6233E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 4, 2021, at 10:22 AM, Israel Brewster = wrote: >=20 >=20 > - and the data table definition: >=20 > Column | Type | Collation | Nullable | = Default =20 > = ----------------+--------------------------+-----------+----------+-------= --------------------------- > id | bigint | | not null | = nextval('data_id_seq'::regclass) > datetime | timestamp with time zone | | not null |=20 > freq_max1 | double precision | | |=20 > freq_max5 | double precision | | |=20 > freq_max10 | double precision | | |=20 > freq_max20 | double precision | | |=20 > freq_max30 | double precision | | |=20 > freq_max40 | double precision | | |=20 > freq_max50 | double precision | | |=20 > freq_max100 | double precision | | |=20 > sd_freq_max5 | double precision | | |=20 > sd_freq_max10 | double precision | | |=20 > sd_freq_max20 | double precision | | |=20 > sd_freq_max30 | double precision | | |=20 > sd_freq_max40 | double precision | | |=20 > sd_freq_max50 | double precision | | |=20 > sd_freq_max100 | double precision | | |=20 > ssa_max1 | double precision | | |=20 > ssa_max5 | double precision | | |=20 > ssa_max10 | double precision | | |=20 > ssa_max20 | double precision | | |=20 > ssa_max30 | double precision | | |=20 > ssa_max40 | double precision | | |=20 > ssa_max50 | double precision | | |=20 > ssa_max100 | double precision | | |=20 > sd_ssa_max5 | double precision | | |=20 > sd_ssa_max10 | double precision | | |=20 > sd_ssa_max20 | double precision | | |=20 > sd_ssa_max30 | double precision | | |=20 > sd_ssa_max40 | double precision | | |=20 > sd_ssa_max50 | double precision | | |=20 > sd_ssa_max100 | double precision | | |=20 > station | smallint | | not null |=20 > channel | character varying(6) | | not null |=20 > epoch | integer | | |=20 > rsam | double precision | | |=20 > sd_rsam | double precision | | |=20 > Indexes: > "data_pkey" PRIMARY KEY, btree (id) > "date_station_channel_idx" UNIQUE, btree (datetime, station, = channel) > "station_channel_epoch_idx" UNIQUE, btree (station, channel, = epoch) > "data_station_channel_idx" btree (station, channel) > "station_data_idx" btree (station) > "station_date_idx" btree (station, datetime) > Foreign-key constraints: > "data_station_fkey" FOREIGN KEY (station) REFERENCES stations(id) > Triggers: > update_epoch BEFORE INSERT OR UPDATE OF datetime ON data FOR EACH = ROW EXECUTE FUNCTION store_epoch() >=20 Guessing the =E2=80=9Csd=E2=80=9D is "standard deviation=E2=80=9D? Any = chance those stddevs are easily calculable from base data? Could cut = your table size in half (and put those 20 cores to work on the = reporting). And I wonder if the last three indices are strictly = necessary? They take disc space too. But my bet is you=E2=80=99re headed for partitioning on datetime or = perhaps station. --Apple-Mail=_3B59198A-43ED-4EA9-AA50-7B103C6233E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Oct 4, 2021, at 10:22 AM, Israel Brewster <ijbrewster@alaska.edu> wrote:


- and the data = table definition:

    =  Column     |         =   Type           | = Collation | Nullable |           =   Default             =  
----------------+--------------------------+-----------+-------= ---+----------------------------------
 id   =           | bigint     =               |   =         | not null | = nextval('data_id_seq'::regclass)
 datetime   =     | timestamp with time zone |     =       | not null | 
 freq_max1      | double = precision         |     =       |        =   | 
 freq_max5    =   | double precision       =   |           |  =         | 
 freq_max10     | double = precision         |     =       |        =   | 
 freq_max20   =   | double precision       =   |           |  =         | 
 freq_max30     | double = precision         |     =       |        =   | 
 freq_max40   =   | double precision       =   |           |  =         | 
 freq_max50     | double = precision         |     =       |        =   | 
 freq_max100    | = double precision         |   =         |        =   | 
 sd_freq_max5   | = double precision         |   =         |        =   | 
 sd_freq_max10  | = double precision         |   =         |        =   | 
 sd_freq_max20  | = double precision         |   =         |        =   | 
 sd_freq_max30  | = double precision         |   =         |        =   | 
 sd_freq_max40  | = double precision         |   =         |        =   | 
 sd_freq_max50  | = double precision         |   =         |        =   | 
 sd_freq_max100 | double = precision         |     =       |        =   | 
 ssa_max1     =   | double precision       =   |           |  =         | 
 ssa_max5       | double = precision         |     =       |        =   | 
 ssa_max10    =   | double precision       =   |           |  =         | 
 ssa_max20      | double = precision         |     =       |        =   | 
 ssa_max30    =   | double precision       =   |           |  =         | 
 ssa_max40      | double = precision         |     =       |        =   | 
 ssa_max50    =   | double precision       =   |           |  =         | 
 ssa_max100     | double = precision         |     =       |        =   | 
 sd_ssa_max5    | = double precision         |   =         |        =   | 
 sd_ssa_max10   | = double precision         |   =         |        =   | 
 sd_ssa_max20   | = double precision         |   =         |        =   | 
 sd_ssa_max30   | = double precision         |   =         |        =   | 
 sd_ssa_max40   | = double precision         |   =         |        =   | 
 sd_ssa_max50   | = double precision         |   =         |        =   | 
 sd_ssa_max100  | = double precision         |   =         |        =   | 
 station      =   | smallint             =     |           | not = null | 
 channel      =   | character varying(6)     |   =         | not null | 
 epoch          | = integer                =   |           |  =         | 
 rsam           | = double precision         |   =         |        =   | 
 sd_rsam      =   | double precision       =   |           |  =         | 
Indexes:
    "data_pkey" PRIMARY KEY, btree (id)
    "date_station_channel_idx" UNIQUE, btree = (datetime, station, channel)
  =   "station_channel_epoch_idx" UNIQUE, btree (station, channel, = epoch)
    "data_station_channel_idx" btree = (station, channel)
    "station_data_idx" = btree (station)
    "station_date_idx" = btree (station, datetime)
Foreign-key constraints:
    "data_station_fkey" FOREIGN KEY (station) = REFERENCES stations(id)
Triggers:
  =   update_epoch BEFORE INSERT OR UPDATE OF datetime ON data FOR = EACH ROW EXECUTE FUNCTION store_epoch()

Guessing the =E2=80=9Csd=E2=80=9D= is "standard deviation=E2=80=9D?  Any chance those stddevs are = easily calculable from base data?  Could cut your table size in = half (and put those 20 cores to work on the reporting).  And I = wonder if the last three indices are strictly necessary? They take disc = space too.

But my bet is you=E2=80=99r= e headed for partitioning on datetime or perhaps station.

= --Apple-Mail=_3B59198A-43ED-4EA9-AA50-7B103C6233E1--