Re: Out of memory running 560 MB query

From: Rosser Schwarz <rosser(dot)schwarz(at)gmail(dot)com>
To: Morgan Ramsay <morgan(dot)ramsay(at)gmail(dot)com>
Cc: PgSQL ADMIN <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Out of memory running 560 MB query
Date: 2014-09-15 00:28:09
Message-ID: CAFnxYwhgfLqyvvgYE-LMbiQHsdMX=jRi6=oR9jSPor2AnH2mWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sun, Sep 14, 2014 at 5:18 PM, Morgan Ramsay <morgan(dot)ramsay(at)gmail(dot)com>
wrote:

> Any idea how to successfully run a query that large? What’s the size limit
> of a query?
>

Without seeing your actual query (or a syntactically similar one, if there
are private details you can't disclose), it's difficult to say. In
general, though, a couple of thoughts come to mind:

Can you run it as a single COPY statement, instead of however many
individual INSERTS? Failing that, can you use the multi-row VALUES syntax
for your INSERT?

As an aside, this type of question is probably more suited for the
pgsql-sql list, rather than -admin.

rls

--
:wq

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Morgan Ramsay 2014-09-15 00:53:39 Re: Out of memory running 560 MB query
Previous Message Morgan Ramsay 2014-09-15 00:18:51 Out of memory running 560 MB query