Re: Query hitting empty tables taking 48 minutes - Mailing list pgsql-general

From Robert Creager
Subject Re: Query hitting empty tables taking 48 minutes
Date
Msg-id EABA22BC-F1E0-4B6D-8AE5-B048AEFD49C6@logicalchaos.org
Whole thread Raw
In response to Re: Query hitting empty tables taking 48 minutes  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general


On Jun 8, 2018, at 10:23 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:

​Not sure what the right answer is but its seems your database (those tables at least) are mis-configured for the workload being ​executed against them.  Significantly increasing the aggressiveness of the auto-vacuum process and/or inserting manual vacuum analyze commands into your application at appropriate times are probably necessary.


I’m fine with changing up table parameters, which is the option that would make sense for us (thanks for pointing that out).  I have the auto vacuum threshold high because of other huge tables, and was not aware of the per table settings.  I’ll use this excuse one time, I inherited this setup, now I own it :-)

I’m concerned about a query that’s going against two tables that have had 300k entries in them (ie now empty and 2 entries) taking so long.  Even if those tables where full, the query should of taken no time at all.  The machine has 64GB memory, 12 physical cores (+12 hyper threads) and the storage is on a ZFS pool with 5 mirrored vdevs of 7.2k SAS drives.  The entire db size is 2.63GB, easily fitting into memory.  This is a production appliance, and is build to handle the load.  Obviously needs some intelligent tuning though.


nspnamerelnamen_tup_insn_tup_updn_tup_deln_live_tupn_dead_tupreltuplesav_thresholdlast_vacuumlast_analyzeav_neededpct_dead
ds3blob303498255930349620250002018-06-08 04:35:00.000000NULLfalse0
ds3job_entry30365981530365900050002018-06-08 04:35:00.000000NULLfalse0

Best,
Robert

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Query hitting empty tables taking 48 minutes
Next
From: Alexey Dokuchaev
Date:
Subject: (2^63 - 1)::bigint => out of range? (because of the double precision)