Question

To make updates faster, I am using:

ALTER TABLE imagingresourceplanning.opnav_fact_revenue_costs SET UNLOGGED ;

What are the drawbacks of this command?

What will happen if system crashes during the update? Is all the data present in the table deleted? Or only the updates which are being done will be lost?

Was it helpful?

Solution

Logging is in reference to Write-Ahead-Logs.

Essentially, everything gets written ahead of time to a log. That log can be played back at any point in time if there is a problem with database constancy (crash-safety). This means data is written twice, once to the log with representation in memory, and a later point in time flushed to the table's heap.

The log can also be shipped to a slave and can play a role in point-in-time (PITR) replication.

Check out the documents on the PostgreSQL implementation of Write-Ahead logging for more information.


If the system crashes (not shut down cleanly), the contents of unlogged tables will be deleted as stated in the manual:

However, they are not crash-safe: an unlogged table is automatically truncated after a crash or unclean shutdown

OTHER TIPS

Unlogged tables are not written in the write ahead log. In the case of a crash the data can not be retrieved.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top