Pô, e que tal fazer o "LIMIT n" dentro da própria função em PL/PgSQL?

Antes de conhecer a razão, trabalhei com Windows, Delphi e Firebird/InterBase. Hoje não imagino como um SGBD pode ter performance baseando-se num único arquivo! No PostgreSQL, até separo o Log de Transações (WAL) num outro HD a fim de obter melhor desempenho em atualizações.

Existem várias perfumarias a serem aplicadas no PostgreSQL (como o ALTER TABLE...POSITION), mas como o core preza pelo padrão ANSI (cujo MySQL desconhece), olha o exemplo de um post recente no pg-hackers:

"A way to store query results in a named buffer and reuse them in the next queries."

E eis a resposta padrão do Tom Lane:

"Why not just fix the speed issues you're complaining about with temp tables?  I see no reason to invent a new concept."

Hehe. Ah, a extensão do Firebird não é .MDB, mas .GDB ou .FDB.

--
Rodrigo Hjort
http://icewall.org/~hjort


2006/5/8, marlon david de souza <[EMAIL PROTECTED] >:
É exatamente isso que eu tinha detectado!
Pelo que eu ententi, pretende-se resolver isso nas próximas versões do Post.

Obs: Aumentei consideravelmente o valor do parâmetro "work_mem" mas não houve
melhoras.

Em Seg 08 Mai 2006 00:56, Otacilio Neto escreveu:
> Encontrei isto no manual:
>
> 36.7.1.2 RETURN NEXT
>
> Note
> The current implementation of RETURN NEXT for PL/pgSQL
> stores the entire result set before returning from the
> function, as discussed above. That means that if a
> PL/pgSQL function produces a very large result set,
> performance may be poor: data will be written to disk
> to avoid memory exhaustion, but the function itself
> will not return until the entire result set has been
> generated. A future version of PL/pgSQL may allow
> users to define set-returning functions that do not
> have this limitation. Currently, the point at which
> data begins being written to disk is controlled by the
> work_mem configuration variable. Administrators who
> have sufficient memory to store larger result sets in
> memory should consider increasing this parameter
_______________________________________________
Grupo de Usuários do PostgreSQL no Brasil
http://www.postgresql.org.br

_______________________________________________
Grupo de Usuários do PostgreSQL no Brasil
http://www.postgresql.org.br

Responder a