Re: Remove sort files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Remove sort files
Date: 2001-05-23 19:40:50
Message-ID: 200105231940.f4NJeol07251@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> > New command is:
>
> > snprintf(clear_pg_sorttemp, sizeof(clear_pg_sorttemp),
> > "rm -f \"%s\"/base/*/pg_sorttemp/*",
> > DataDir);
>
> I said cd for a reason: if you do it that way, you've cut the maximum
> number of files you can delete by at least an order of magnitude,
> depending on how long DataDir is.
>
> Why do we need per-database sorttemp areas anyway? Seems better to have
> an installation-wide one.

OK, here is the new code:

snprintf(clear_pg_sorttemp, sizeof(clear_pg_sorttemp),
"sh -c '\
cd \"%s\"/base && \
ls | while read DIR; \
do \
export DIR; \
(cd \"$DIR\"/pg_sorttemp/ 2>/dev/null && rm -f *); \
done'",
DataDir);

--
Bruce Momjian | http://candle.pha.pa.us
pgman(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

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-05-23 19:46:34 Re: Remove sort files
Previous Message Bruce Momjian 2001-05-23 19:30:03 ANT fix for jar creation