Re: [HACKERS] Postgres Speed or lack thereof

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Massimo Dal Zotto <dz(at)cs(dot)unitn(dot)it>
Cc: PostgreSQL Hackers <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Postgres Speed or lack thereof
Date: 1999-07-07 01:25:48
Message-ID: 199907070125.VAA29045@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I have added this to the TODO list:

* improve dynamic memory allocation by introducing tuple-context memory
allocation
* add pooled memory allocation where allocations are freed only as a
group

> We could use 4 methods for dynamic allocation:
>
> 1) malloc/free - for persistent storage allocation
>
> 2) palloc/pfree - for storage belonging to some context and
> which we can keep track of and free explicitly
>
> 3) fast_palloc - for storage which impossible, too difficult or too
> expensive to keep track of. This storage should be allocated with
> fast and simple inline code from bigger chunks allocated with palloc.
> This storage would never freed explicitly, so that code could be
> simple and fast, but the big chunks would be freed automatically at
> the end of the transaction.
>
> 4) fast_talloc - we could introduce a `tuple' context handled like
> fast_palloc for storage used only while processing one tuple.
> This storage could be fast allocated from few big chunks allocated
> with palloc and freed explicitly after the tuple has been processed.
> This could avoid the overhead of many malloc/palloc while reducing
> the overall memory usage for transaction which process many rows.
> The total cost per tuple could be one palloc and one pfree.
> We could also simply reuse the chunks for every tuple and pfree them
> only at the end of the transaction. This would cost one palloc/pfree
> per transaction.
>
> This would require revising the code and changing palloc/pfree with the new
> functions where appropriate, but this could be done gradually because the
> old palloc/pfree are always safe.
>
> --
> Massimo Dal Zotto
>
> +----------------------------------------------------------------------+
> | Massimo Dal Zotto email: dz(at)cs(dot)unitn(dot)it |
> | Via Marconi, 141 phone: ++39-0461534251 |
> | 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |
> | Italy pgp: finger dz(at)tango(dot)cs(dot)unitn(dot)it |
> +----------------------------------------------------------------------+
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-07-07 01:49:34 Re: [HACKERS] 6.5 beta and ORDER BY patch
Previous Message Bruce Momjian 1999-07-07 01:25:12 Re: [HACKERS] new heap manager mmalloc