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 1mcmK8-0003rb-Qx for pgsql-performance@arkaria.postgresql.org; Tue, 19 Oct 2021 10:26:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mcmK6-0007Da-Qm for pgsql-performance@arkaria.postgresql.org; Tue, 19 Oct 2021 10:26:22 +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 1mcmK6-0007DQ-Dw for pgsql-performance@lists.postgresql.org; Tue, 19 Oct 2021 10:26:22 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mcmJz-0006Vq-QA for pgsql-performance@lists.postgresql.org; Tue, 19 Oct 2021 10:26:21 +0000 Received: by mail-il1-x132.google.com with SMTP id k3so17873368ilu.2 for ; Tue, 19 Oct 2021 03:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4qyqZfK2YkNi2mEoyLfwPs4SN385EmMfuL1YMOjC3U4=; b=J3CtU7FV4okgmTTvqg74Y9WITjIKY3ItCngpDM4w9G7dWimoGVdqhtMNLpLGzWJlSI Z/T0JRrZNXVrCbFPodv5mghJYKHjKiZFqBBdeDsAT8smXfPw1xAsHxzasNaArfA+5tGp ZLofRXnk7jNdW7K0V1pyZf80j4tZ/NyPyFqtVt6n5KebyOtaXflLIXXX1syNXCzCQQ7/ LBOqHQnCglreDlWNwXpKP+rlKevU9UKv00QkbSQwOrP0edwrr0jTzLcwI7KsdsHNqYPZ oe7MQB3EIUeIpw+6WItx/HtT7ysHheghL0S8P+6T+QgxLKvhOzCGwuNzXF6KjShUNY0f 8+Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4qyqZfK2YkNi2mEoyLfwPs4SN385EmMfuL1YMOjC3U4=; b=IGFZvx2LeEpwHBM1m6EJWxLXzceZxmGmCPAYXqQp2RFH0EQ9h3DGPt6JbUPwBwIlA8 Dlp2PEC2Wx1KG8pBheJCOS3cul1LW1MgLowiT7V4JmOFxae20sOg3aEOswo2OImsVT/l pvrmogWw//M0A+4ubpuiUHY4aCK8QjSm6GGxcdiPzLkylhMFF11YlpkaB+EqECFh7jNy Qb2bO3w9EG/he+kIhVrMD6rR3WgX3LIIDZJICp1cJ/WZqAow+AapJticCx0GG677VroW 3ocPFs63w/HhVL5m5q9t49gET1shdOfrCrihS3gOBA0wqeNwGoMql1LKYRT+WqMKiwxK i6Cw== X-Gm-Message-State: AOAM532jbfST/l+zJOp8XFmMglF+5FNO8VKTq+J1t6jLBLoUR4QzXkH2 aiGlPWxTDw0h76/EYr6ZZhJTqseGSI9KGA== X-Google-Smtp-Source: ABdhPJwrBwVkvBls8kygMXW9N+jIggpwmu+5pVbI73iRJn8eXi/okU7U8hg8qUdTn6GDQ7cmr5GDZA== X-Received: by 2002:a05:6e02:1c23:: with SMTP id m3mr18328788ilh.194.1634639174487; Tue, 19 Oct 2021 03:26:14 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a12sm8336303ion.0.2021.10.19.03.26.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Oct 2021 03:26:14 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 7AAD8800E86; Tue, 19 Oct 2021 05:26:13 -0500 (CDT) Date: Tue, 19 Oct 2021 05:26:13 -0500 From: Justin Pryzby To: aditya desai Cc: pgsql-performance@lists.postgresql.org Subject: Re: Fwd: Query out of memory Message-ID: <20211019102613.GJ4679@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 19, 2021 at 11:28:46AM +0530, aditya desai wrote: > I am running the below query. Table has 21 million records. I get an Out Of > Memory error after a while.(from both pgadmin and psql). Can someone review Is the out of memory error on the client side ? Then you've simply returned more rows than the client can support. In that case, you can run it with "explain analyze" to prove that the server side can run the query. That returns no data rows to the client, but shows the number of rows which would normally be returned. -- Justin