title: Use PostgreSQL pg_prewarm for a foreign table
body: <p>I have many foreign tables imported by <code>IMPORT FOREIGN SCHEMA</code>:</p>
  
  <pre><code>CREATE USER MAPPING FOR myuser
     SERVER postgres
     OPTIONS ( user 'myuser', password 'mypass');
  IMPORT FOREIGN SCHEMA public from server postgres INTO public;
  </code></pre>
  
  <p>I have many queries that join my local tables and foreign tables.</p>
  
  <p>Q1: If I use <code>pg_prewarm</code> and the put the whole table in memory, it helps me not every time to take this table by a network.</p>
  
  <p>Q2: I am worried if data changes on the foreign PostgreSQL server will be visible on my local server if the foreign table is cached.</p>
  
  <p>Example: <code>core_category</code> is a foreign table</p>
  
  <pre><code>SELECT pg_prewarm(
      'core_category',
      -- "pre warm" pages of the last 1000 pages for 'mytable'
      first_block := (
          SELECT pg_relation_size('core_category') / current_setting('block_size')::int4 - 1000
      )
  );
  -- or
  SELECT * FROM pg_prewarm('core_category', 'buffer');
  </code></pre>