News for hackers. Stuff that matters.
Re:Hstore development for 9.4 release by clubhi on Thursday November 07, 2013 @11:35AM (#6690331)
Postgres also has stupid mode option. (unlogged)
Re:Hstore development for 9.4 release by pilif on Thursday November 07, 2013 @12:11PM (#6690597)
The feature works per table and is off by default. Unlogged tables have another nice property: If the data gets corrupted somehow, then the table will be completely empty. This makes it clear to users that you'd use unlogged tables for caching or other data that you have no problem with losing.

It also means that you can be sure that the data you read from an unlogged table is that data that you put there. I much prefer this over the possibility of maybe reading corrupt data without any possibility of detection.

In my case, the use-case of an unlogged table is a table that practically works like a materialized view (until postgres learns to refresh them without an exclusive lock and maybe even automatically as the underlying data changes). If the table is empty, I can easily recreate the data, so I don't care about any kind of WAL logging or replication. If the table's there, perfect. I'll use it instead of a ton of joins and an equally big amount of application logic.

If the data isn't there, well. Then I run that application logic which will cause the joins to happen. So that's way, way slower, but it'll work the same.

The advantage of using an unlogged table here is that it's cheaper to update it and it doesn't use replication traffic (unlogged tables are not replicated).

Re:Hstore development for 9.4 release by rch on Thursday November 07, 2013 @11:42AM (#6690377)
I think it's been referred to as 'running with scissors' mode actually.
Re:Hstore development for 9.4 release by effn on Thursday November 07, 2013 @12:26PM (#6690729)
You can also tune the fsync option to get mongo-like performance and reliability.
Re:Hstore development for 9.4 release by rdtsc on Thursday November 07, 2013 @12:41PM (#6690855)
It isn't turned on by default just like it was in MongoDB initially.
Re:Hstore development for 9.4 release by aschreyer on Thursday November 07, 2013 @01:40PM (#6691383)
It is not stupid it actually makes sense for ETL workflows where you load raw data into unlogged tables and transform them in the database into the final (logged) representation.