Re: [HACKERS] libpq: why we need to fetch all rows? - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] libpq: why we need to fetch all rows?
Date
Msg-id 4e60be36e455a8eb63986cea11e4ff33
Whole thread Raw
In response to [HACKERS] libpq: why we need to fetch all rows?  (Alexander Demenshin <aldem@techie.com>)
List pgsql-hackers
Bruce Momjian wrote:
>
> > Please give examples of true RDBMS SQL servers which return rows before
> > completing the database scan.
>
> My comments exactly.  I know of no such SQL engine.  Now, there are some
> which will keep the RESULTS on the server, and only return them
> one-by-one.  That may be a speed savings.  Also, if your query uses
> ORDER BY, I am in the process of improving the performance of that code.

Another possibility is to multi-thread the pqlib front end, so it can
start returning rows while rows are still coming from the backend. For
fast machines or for a few rows, there would be no performance
improvement, but for really big queries you might notice a significant
difference.

There have been several threads of discussion regarding multi-threading
in the backend. IMHO, many of the performance gains people are hoping to
get from that would be addressed by multi-threading frontends instead.
For example, a web server version of a frontend could run as a daemon
and connect to several database sessions, then service web requests from
those permanent sessions.

            - Tom

------------------------------

pgsql-hackers by date:

Previous
From: Igor
Date:
Subject: Re: [HACKERS] libpq: why we need to fetch all rows?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] libpq: why we need to fetch all rows?