Re: Performance with very large tables

Поиск
Список
Период
Сортировка
От Jan van der Weijde
Тема Re: Performance with very large tables
Дата
Msg-id 4B9C73D1EB78FE4A81475AE8A553B3C67DC536@exch-lei1.attachmate.com
обсуждение исходный текст
Ответ на Performance with very large tables  ("Jan van der Weijde" <Jan.van.der.Weijde@attachmate.com>)
Ответы Re: Performance with very large tables  ("Shoaib Mir" <shoaibmir@gmail.com>)
Re: Performance with very large tables  (Richard Huxton <dev@archonet.com>)
Re: Performance with very large tables  (Shane Ambler <pgsql@007Marketing.com>)
Список pgsql-general
That is exactly the problem I think. However I do not deliberately
retrieve the entire table. I use the default settings of the PostgreSQL
installation and just execute a simple SELECT * FROM table.
I am using a separate client and server (both XP in the test
environment), but that should not make much difference.
I would expect that the default behavior of PostgreSQL should be such
that without LIMIT, a SELECT returns records immediately.

Thank you,
Jan

-----Original Message-----
From: Alban Hertroys [mailto:alban@magproductions.nl]
Sent: Monday, January 15, 2007 12:49
To: Jan van der Weijde
Cc: Richard Huxton; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Performance with very large tables

Jan van der Weijde wrote:
> Thank you.
> It is true he want to have the first few record quickly and then
> continue with the next records. However without LIMIT it already takes

> a very long time before the first record is returned.
> I reproduced this with a table with 1.1 million records on an XP
> machine and in my case it took about 25 seconds before the select
> returned the first record. I tried it both interactively with pgAdmin
> and with a C-application using a cursor (with hold). Both took about
the same time.

Are you sure you don't retrieve the entire result set first, and only
start iterating it after that? Notably the fact that LIMIT changes this
behaviour seems to point in that direction.

A quick calculation shows that (provided my assumption holds true)
fetching each record takes about 12.5 usec on average (25s / 2m
records). A quick test on our dev-db fetches (~40k records) in 5 usec
average, so that looks reasonable to me (apples and oranges, I know).

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: check table existence...
Следующее
От: "Shoaib Mir"
Дата:
Сообщение: Re: check table existence...