Re: pg_prewarm - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: pg_prewarm
Date
Msg-id CAJKUy5g9rj2wJuusR_T-WFk03i1C4fTBOsH3q0RQvhFytehR9g@mail.gmail.com
Whole thread Raw
In response to pg_prewarm  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Mar 8, 2012 at 11:13 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> It's been bugging me for a while now that we don't have a prewarming
> utility, for a couple of reasons, including:
>
> 1. Our customers look at me funny when I suggest that they use
> pg_relation_filepath() and /bin/dd for this purpose.
>

well, you can't deny that is funny see people doing faces ;)

>
> So I wrote a prewarming utility.  Patch is attached.

cool!

just a suggestion, can we relax this check? just send a WARNING or a
NOTICE and set "last_block = nblocks - 1"
just an opinion

+    if (PG_ARGISNULL(4))
+        last_block = nblocks - 1;
+    else
+    {
+        last_block = PG_GETARG_INT64(4);
+        if (last_block > nblocks)
+            ereport(ERROR,
+                    (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                     errmsg("ending block number " INT64_FORMAT " exceeds number of
blocks in relation " INT64_FORMAT, last_block, nblocks)));
+    }

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: pg_prewarm
Next
From: Tom Lane
Date:
Subject: Re: pgsql_fdw, FDW for PostgreSQL server