Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Assuming that your tables of interest have (or can be augmented with) a unique, indexed, sequential key, then you will get much much better value out of simply issuing <code>SELECT ... FROM table ... WHERE key &gt; :last_max_key</code> with output to a file, where <code>last_max_key</code> is the last key value from the last extraction (0 if first extraction.) This <strong>incremental, decoupled approach avoids</strong> introducing <strong>trigger latency in the insertion datapath</strong> (be it custom triggers or modified Slony), and depending on your setup could scale better with number of CPUs etc. (However, if you also have to <strong>track <code>UPDATE</code>s</strong>, and the sequential key was added by you, then your <code>UPDATE</code> statements should <code>SET</code> the key column to <code>NULL</code> so it gets a new value and gets picked by the next extraction. You would <strong>not be able to track <code>DELETE</code>s</strong> without a trigger.) Is this what you had in mind when you mentioned Talend?</p> <p>I would <strong>not use the logging facility unless you cannot implement the solution above</strong>; logging most likely involves <strong>locking overhead</strong> to ensure log lines are written sequentially and do not overlap/overwrite each other when multiple backends write to the log (check the Postgres source.) The locking overhead may not be catastrophic, but you can do without it if you can use the incremental <code>SELECT</code> alternative. Moreover, <strong>statement logging would drown out</strong> any useful WARNING or ERROR messages, and the <strong>parsing itself will not be instantaneous</strong>.</p> <p>Unless you are willing to parse WALs (including transaction state tracking, and being ready to rewrite the code everytime you upgrade Postgres) I would not necessarily use the WALs either -- that is, unless you <strong>have the extra hardware available</strong>, in which case you could <strong>ship WALs to another machine for extraction</strong> (on the second machine you can <strong>use triggers shamelessly</strong> -- or even statement logging -- since whatever happens there does not affect <code>INSERT</code>/<code>UPDATE</code>/<code>DELETE</code> performance on the primary machine.) Note that performance-wise (on the primary machine), unless you can write the logs to a SAN, you'd get a comparable performance hit (in terms of thrashing filesystem cache, mostly) from shipping WALs to a different machine as from running the incremental <code>SELECT</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload