Re: WAL + SSD = slow inserts? - Mailing list pgsql-performance

From Skarsol
Subject Re: WAL + SSD = slow inserts?
Date
Msg-id CAMt8e=GPCAss1ft-aW0W5CvMORTp95Pyzw9OcVbEUjtKHCS4bw@mail.gmail.com
Whole thread Raw
In response to Re: WAL + SSD = slow inserts?  (bricklen <bricklen@gmail.com>)
Responses Re: WAL + SSD = slow inserts?  (Rosser Schwarz <rosser.schwarz@gmail.com>)
List pgsql-performance
On Thu, Dec 5, 2013 at 1:19 PM, bricklen <bricklen@gmail.com> wrote:

On Thu, Dec 5, 2013 at 10:08 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
Rules have a lot of overhead. Is there a reason you're not using
defaults or triggers?

Or for even less overhead, load the partitions directly, and preferably use "DEFAULT nextval('some_sequence')" as Scott mentioned.


The rule is being used to return the id of the insert, it's not part of the partitioning itself. The id is generated with default nextval. I've looked at using returning instead but that will require a large refactoring of the codebase and seems to have issues when combined with the partitioning. The partitioning is done with a BEFORE INSERT ON trigger. The trigger proc doesn't do any selects, it's just based on the contents of the insert itself.

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: One huge db vs many small dbs
Next
From: Pavel Stehule
Date:
Subject: Re: One huge db vs many small dbs