Skip site navigation (1) Skip section navigation (2)

BUG #2475: Row limit problem

From: "Sebastiaan van Erk" <sebster-postgresql(at)sebster(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2475: Row limit problem
Date: 2006-06-09 14:53:25
Message-ID: 200606091453.k59ErPev073490@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2475
Logged by:          Sebastiaan van Erk
Email address:      sebster-postgresql(at)sebster(dot)com
PostgreSQL version: 8.1.4
Operating system:   Windows XP
Description:        Row limit problem
Details: 

When using the "raw" protocol (such as JDBC uses) it seems that the row
limit is ignored.

The following code in the JDBC driver:

        // Total size = 4 (size field) + 1 + N (source portal) + 4 (max
rows)
        pgStream.SendChar('E');              // Execute
        pgStream.SendInteger4(4 + 1 + encodedSize + 4);  // message size
        if (encodedPortalName != null)
            pgStream.Send(encodedPortalName); // portal name
        pgStream.SendChar(0);                 // portal name terminator
        pgStream.SendInteger4(limit);       // row limit

in v3/QueryExecuterImpl.java (latest non-dev version) DOES send the limit to
the database (and debugging showed it was the correct limit), however the
database seems to ignore it. We tried the following query namely (with the
above limit):

Query "select action_id from actions order by action_id" elapsed time
(seconds) - Total: 1.937, SQL query time: 1.562, Building output time: 0.375


However when we actually put a limit in the query itself we get the
following:

Query "select action_id from actions order by action_id limit 100" elapsed
time (seconds) - Total: 0.156, SQL query time: 0.047, Building output time:
0.109

This shows the ENORMOUS different time it takes for the  two queries even
though they both have the limit set.

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-06-09 15:18:23
Subject: Re: How to set the global OID counter? COPY WITH OIDS does
Previous:From: Colin FreasDate: 2006-06-09 14:49:49
Subject: Re: How to set the global OID counter? COPY WITH OIDS does

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group