Thread: Minimising disk writes

Minimising disk writes

From
Andy Chambers
Date:
Hi,

I'm at the investigation stage of a project that
involves putting
a database on an embedded device.  One of the problems
we face is
that the filesystem is on Flash Memory so we need to
minimize any
writes.

Looking at the docs, it seems that temp_buffers, and
work_mem are
the two variables we might play about with to achieve
this.  Are
there any others I should be aware of?

Is it just a bad idea to use postgresql for this type
of thing?

Regards,
Andy




___________________________________________________________
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal
http://uk.docs.yahoo.com/nowyoucan.html

Re: Minimising disk writes

From
Tom Lane
Date:
Andy Chambers <andychambers2002@yahoo.co.uk> writes:
> I'm at the investigation stage of a project that involves putting a
> database on an embedded device.  One of the problems we face is that
> the filesystem is on Flash Memory so we need to minimize any writes.

> Is it just a bad idea to use postgresql for this type of thing?

Fraid so ... PG is not designed with the idea of avoiding disk writes,
indeed it's pretty aggressive at pushing committed data out to disk.
You could maybe get away with flash storage for a read-mostly, very
low update rate database, but the software isn't going to help you
do it :-(

            regards, tom lane

Re: Minimising disk writes

From
"Andrej Ricnik-Bay"
Date:
On 8/12/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > I'm at the investigation stage of a project that involves putting a
> > database on an embedded device.  One of the problems we face is that
> > the filesystem is on Flash Memory so we need to minimize any writes.

> > Is it just a bad idea to use postgresql for this type of thing?
> Fraid so ... PG is not designed with the idea of avoiding disk writes,
> indeed it's pretty aggressive at pushing committed data out to disk.
> You could maybe get away with flash storage for a read-mostly, very
> low update rate database, but the software isn't going to help you
> do it :-(
How feasible would it be to have the pg_data structure copied from
the Flash to e.g. a RAM disk, and only write it back occasionally? Or
have the "busier" parts, if the application has such, in RAM.
Of course I have no idea how big the flash-memory and the actual
RAM are, and the idea may be completely off.


Cheers,
Andrej

Re: Minimising disk writes

From
Andrew Chambers
Date:
* Tom Lane <tgl@sss.pgh.pa.us> [2006-08-11 08:41:16 -0400]:

> Andy Chambers <andychambers2002@yahoo.co.uk> writes:
> > I'm at the investigation stage of a project that involves putting a
> > database on an embedded device.  One of the problems we face is that
> > the filesystem is on Flash Memory so we need to minimize any writes.
>
> > Is it just a bad idea to use postgresql for this type of thing?
>
> Fraid so ... PG is not designed with the idea of avoiding disk writes,
> indeed it's pretty aggressive at pushing committed data out to disk.
> You could maybe get away with flash storage for a read-mostly, very
> low update rate database, but the software isn't going to help you
> do it :-(

I assumed that one can't really avoid writing to disk when committing
data (do any free databases try to avoid this?).  I was more worried
about temporary tables created in join and sort operations.

Thanks,
Andy



___________________________________________________________
Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free.
http://uk.docs.yahoo.com/trueswitch2.html