Re: BUG #14027: n_tup_ins increments regardless of insertion success - Mailing list pgsql-bugs

From Ilya Matveychikov
Subject Re: BUG #14027: n_tup_ins increments regardless of insertion success
Date
Msg-id CAKh5naaAgzxZa+QK84Fh_VVRB0=cVE-oMmErAV4OPg-5jsbeiw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #14027: n_tup_ins increments regardless of insertion success  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
2016-03-19 4:08 GMT+03:00 David G. Johnston <david.g.johnston@gmail.com>:

> To help explain why - consider that PostgreSQL is basically optimistic in
> its behavior.  It writes out data expecting that the various constraints are
> going to succeed and that the transaction as a whole will be committed.  If
> at any point the written data is deemed to be invalid it is marked as have
> been (for practical purposes) "deleted"
>
> just as if you had done an SQL DELETE on a valid record.  Its just that in
> this instance the data in question was never visible outside of its
> transaction.  It is, however, physically present and thus eligible for
> vacuum and contributes to the statistics of the database.

David, thanks for the explanation. Now that's clear to me.

pgsql-bugs by date:

Previous
From: David Gould
Date:
Subject: Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower.
Next
From: Tom Lane
Date:
Subject: Re: BUG #14031: Failed to Write to History File