Re: Understanding memory usage

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Damiano Albani <damiano(dot)albani(at)gmail(dot)com>
Cc: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: Understanding memory usage
Date: 2013-10-28 23:23:11
Message-ID: CA+mi_8YMYqWNeXN=6Un0vAU8yFtoe5xqwLguPabBq72axHSMWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Mon, Oct 28, 2013 at 9:28 PM, Damiano Albani
<damiano(dot)albani(at)gmail(dot)com> wrote:

> But what is the reason why Psycopg needs memory to just run a query, without
> fetching results?

Because the result is returned to the client as the response for the
query and is stored inside the cursor. fetch*() only return it to
Python.

The behaviour of actually getting the result on fetch*() is obtained
using a server-side cursor. The price you pay is more network
roundtrips and more resources used by the server.

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Damiano Albani 2013-10-30 17:24:59 Re: Understanding memory usage
Previous Message Damiano Albani 2013-10-28 21:28:56 Understanding memory usage