Re: query against pg_locks leads to large memory alloc

From: Dave Owens <dave(at)teamunify(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Matheus de Oliveira <matioli(dot)matheus(at)gmail(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query against pg_locks leads to large memory alloc
Date: 2014-08-18 21:36:52
Message-ID: CA+OQrzhBziFavzH==iqrJegR5Us6q7EvbopkQAWJV9f-UYVthQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Aug 18, 2014 at 2:21 PM, Matheus de Oliveira
<matioli(dot)matheus(at)gmail(dot)com> wrote:
> Do you really need such large values? What is your max_connections value?

max_connections = 450 ...we have found that we run out of shared
memory when max_pred_locks_per_transaction is less than 30k.

On Mon, Aug 18, 2014 at 2:29 PM, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:
> performance of any query to pg_locks is proportional to the setting of
> max_locks_per_transaction. still, something is awry here. can you
> 'explain' that query?

tudb=# explain SELECT mode, count(mode) AS count FROM pg_locks GROUP
BY mode ORDER BY mode;
QUERY PLAN
-------------------------------------------------------------------------------------
Sort (cost=0.63..0.65 rows=200 width=32)
Sort Key: l.mode
-> HashAggregate (cost=0.30..0.32 rows=200 width=32)
-> Function Scan on pg_lock_status l (cost=0.00..0.10
rows=1000 width=32)
(4 rows)

> SELECT COUNT(*) from pg_locks;

ERROR: invalid memory alloc request size 1562436816

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2014-08-18 22:01:47 Re: query against pg_locks leads to large memory alloc
Previous Message Merlin Moncure 2014-08-18 21:29:10 Re: query against pg_locks leads to large memory alloc