pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: smartyru@gmail.com
Subject: BUG #16254: SQL raises error dsa_allocate could not find 4 free pages
Date: Tue, 11 Feb 2020 12:34:28 +0000
Message-ID: <16254-aefd2302eadadb8f@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16254
Logged by:          Алексей Божков
Email address:      smartyru@gmail.com
PostgreSQL version: 10.5
Operating system:   CentOS Linux release 7.5.1804 (Core)
Description:        

After refactoring of a SQL query during run of new version of the query
given below 
select count( distinct case when proc_error_cd = '000' then 'ok@' end ||
muid || '@' || email ),
count( distinct case when proc_error_cd = '000' then null else 'err@' end ||
muid || '@' || email )
 into v_in_cnt, v_in_cnt_err
from cb.T co
where  check_dt_msk between v_check_dt_min and v_check_dt_max
and cashback <> 0
and calc_batch_id = any(v_calc_batch_id_ar)
and muid = any (v_muid_ar);

where 
v_muid_ar, v_calc_batch_id_ar - are arrays of (183 and 4167 scalar elements
populated below)
select array_agg(distinct muid)
  into v_muid_ar
  from cb.rsp_tst
  where txncode in ('29', '18')
  and tsid::int = v_tsid;

  select array_agg(distinct calc_batch_id)
  into v_calc_batch_id_ar
  from cbf.calc_batch_dt_range
  where batch_group_id = v_tsid;
I got error dsa_allocate could not find 4 free pages

Old version of query runs without errors:
select count( distinct case when proc_error_cd = '000' then 'ok@' end ||
muid || '@' || email ),
                       count( distinct case when proc_error_cd = '000' then
null else 'err@' end || muid || '@' || email )
                    into v_in_cnt, v_in_cnt_err
                    from cb.T co, cbf.calc_batch_dt_range rn
                    where 1=1
                      and check_dt_msk between v_check_dt_min and
v_check_dt_max
                      and cashback <> 0
                      and co.calc_batch_id = rn.calc_batch_id
                      and batch_group_id = v_tsid
                      and muid in ( select  unnest ( v_muid_ar ) );

cb.T is a view of a few mln rows



view thread (2+ messages)  latest in thread

Message-ID: <16254-aefd2302eadadb8f@postgresql.org>
Permalink:  ../16254-aefd2302eadadb8f@postgresql.org/
Also on:    postgresql.org/message-id/16254-aefd2302eadadb8f@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, smartyru@gmail.com
  Subject: Re: BUG #16254: SQL raises error dsa_allocate could not find 4 free pages
  In-Reply-To: <16254-aefd2302eadadb8f@postgresql.org>
  References: <16254-aefd2302eadadb8f@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox