1

I'm wondering if there is no paging feature for the pgAdmin III 1.22.1 Query tool.

So if I try to query a table with 500k+ rows without constraints, the query takes like 30s.

Is there a paging option?
Can I limit the default result size?

Am I missing something here?

  • 3
    I see: right click on a table -> View Data -> View Top 100 Rows – ypercubeᵀᴹ Jun 27 '16 at 10:27
  • 3
    May I ask why you do that? 500k+ rows of any table is very boring to read... – dezso Jun 27 '16 at 11:24
  • to be honest, this used to be my workflow, top down, chip off what's not needed... – Franz Ebner Jun 28 '16 at 7:22
1

If You are querying just one table (like SELECT * FROM table) then right click on it in Object browser, choose View Data from context menu, You will have options to View Top 100 Rows or View Last 100 Rows.

Other than that, use LIMIT and OFFSET clauses in Your queries: https://www.postgresql.org/docs/9.3/static/queries-limit.html

  • Thanks for your answer! Just changed from Oracle to PG and was wondering why queries take that long, while oracles SQLDeveloper pages at queries like this. – Franz Ebner Jun 27 '16 at 11:40
  • I'm always forgetting about that default option in SQL Developer and then run query again "as script" or just with export. But that's how SQL Developer works. Psql client works in similar way, don't remember about TOra (yea, You can do some PostgreSQL work with it). I think SQurreL worked the same way (another Java GUI). HeidiSQL seems to query top 1000 rows when browsing tables in GUI, otherwise requires stating LIMIT too. – Marcin S. Jun 27 '16 at 11:50
1

Using pgAdmin III, I ran the following command to generate 100,000 random records.

create table t_random as select s, md5(random()::text) from generate_Series(1, 100000) s;

I then did as MarcinS suggested in his answer:

"right click on it in Object browser, choose View Data from context menu, You will have options to View Top 100 Rows or View Last 100 Rows"

And I do indeed get the first 100 rows. But then, try as I might, I can't go on to the next 100.

AIUI, you want the first 100 to spring up quickly and then be able to scroll through the remaining ones - i.e. not to be kept waiting while 500k+ records are retrieved?

I believe that I know what you're getting at - I've had to do this sort of mind-numbing stuff for College projects - sometimes there's no substitute for "eye-balling" your data.

So, as far as I'm concerned, the available functionality is not "paging" as I would understand it.

If you'd care to put in a feature request, I'd be only too happy to file a "me-too" if you provide a link to your request.

  • meta already cared about paging vs pagination: meta.stackexchange.com/a/118522/186498 ;) – Franz Ebner Jun 28 '16 at 7:17
  • 1
    And does meta care about how many angels dance around the head of a pin? :-). I was using the word paging here in the context of the English language and not the IT term. In an English speaking IT office one will frequently hear phrases like "I had to page through a huge manual to find what I wanted". Plus, there was no hint in your questio that you were discussing computer memory management strategies. – Vérace Jun 28 '16 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.