Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-09 Thread Andres Freund
On 2015-07-09 10:39:35 -0300, Fabrízio de Royes Mello wrote:
 If the wal_level=minimal we don't need to force the wal log of the
 contents. If the wal_level != minimal we need just to xlog all the pages,
 but in both cases we don't need the extra job to create a new datafiles and
 copy the contents between them. So we'll improve performance, or am I
 missing something?

Sure. It'll be a bit faster. I just don't see the peformance increase in
not that common situations being worth the price we'll pay in
development, code review, debugging and then maintaining some nontrivial
code. If this were likely to be a 15 line patch, I'd think differently.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-09 Thread Fabrízio de Royes Mello
On Thu, Jul 9, 2015 at 10:56 AM, Andres Freund and...@anarazel.de wrote:

 On 2015-07-09 10:39:35 -0300, Fabrízio de Royes Mello wrote:
  If the wal_level=minimal we don't need to force the wal log of the
  contents. If the wal_level != minimal we need just to xlog all the
pages,
  but in both cases we don't need the extra job to create a new datafiles
and
  copy the contents between them. So we'll improve performance, or am I
  missing something?

 Sure. It'll be a bit faster. I just don't see the peformance increase in
 not that common situations being worth the price we'll pay in
 development, code review, debugging and then maintaining some nontrivial
 code. If this were likely to be a 15 line patch, I'd think differently.

Well, this will not be a 15 line patch, but I'll try to simplify as much as
possible.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
 Timbira: http://www.timbira.com.br
 Blog: http://fabriziomello.github.io
 Linkedin: http://br.linkedin.com/in/fabriziomello
 Twitter: http://twitter.com/fabriziomello
 Github: http://github.com/fabriziomello


Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-09 Thread Tom Lane
Andres Freund and...@anarazel.de writes:
 On 2015-07-09 10:39:35 -0300, Fabrízio de Royes Mello wrote:
 If the wal_level=minimal we don't need to force the wal log of the
 contents. If the wal_level != minimal we need just to xlog all the pages,
 but in both cases we don't need the extra job to create a new datafiles and
 copy the contents between them. So we'll improve performance, or am I
 missing something?

 Sure. It'll be a bit faster. I just don't see the peformance increase in
 not that common situations being worth the price we'll pay in
 development, code review, debugging and then maintaining some nontrivial
 code. If this were likely to be a 15 line patch, I'd think differently.

I'm even more worried about the possible reliability problems (ie
introduction of bugs, which are likely to be of the data-eating variety)
that such changes are likely to incur.  So I tend to agree with Andres
that this is probably not a good idea.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-09 Thread Fabrízio de Royes Mello
On Wed, Jul 8, 2015 at 11:37 AM, Andres Freund and...@anarazel.de wrote:

 On 2015-07-08 10:58:51 -0300, Fabrízio de Royes Mello wrote:
  Think in an ETL job that can be use an unlogged table to improve the
load
  performance, but this job create a large table and to guarantee the
data
  consistency you need to transform it into a regular table, and with the
  current implementation rewrite the entire heap, toast and indexes.

 Don't buy that. The final target relation will usually already have
 content. Also everything but wal_level=minimal will force you to WAL log
 the contents anyway.

If the wal_level=minimal we don't need to force the wal log of the
contents. If the wal_level != minimal we need just to xlog all the pages,
but in both cases we don't need the extra job to create a new datafiles and
copy the contents between them. So we'll improve performance, or am I
missing something?

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
 Timbira: http://www.timbira.com.br
 Blog: http://fabriziomello.github.io
 Linkedin: http://br.linkedin.com/in/fabriziomello
 Twitter: http://twitter.com/fabriziomello
 Github: http://github.com/fabriziomello


Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-08 Thread Andres Freund
On 2015-07-03 08:18:09 -0300, Fabrízio de Royes Mello wrote:
 *** ALTER TABLE changes
 ...

Without going into the specifics of this change: Are we actually sure
this feature warrants the complexity it'll introduce? I'm really rather
doubtful.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-08 Thread Fabrízio de Royes Mello
On Wed, Jul 8, 2015 at 10:53 AM, Andres Freund and...@anarazel.de wrote:

 On 2015-07-03 08:18:09 -0300, Fabrízio de Royes Mello wrote:
  *** ALTER TABLE changes
  ...

 Without going into the specifics of this change: Are we actually sure
 this feature warrants the complexity it'll introduce? I'm really rather
 doubtful.

Think in an ETL job that can be use an unlogged table to improve the load
performance, but this job create a large table and to guarantee the data
consistency you need to transform it into a regular table, and with the
current implementation rewrite the entire heap, toast and indexes.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
 Timbira: http://www.timbira.com.br
 Blog: http://fabriziomello.github.io
 Linkedin: http://br.linkedin.com/in/fabriziomello
 Twitter: http://twitter.com/fabriziomello
 Github: http://github.com/fabriziomello


Re: [HACKERS] Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement

2015-07-08 Thread Andres Freund
On 2015-07-08 10:58:51 -0300, Fabrízio de Royes Mello wrote:
 Think in an ETL job that can be use an unlogged table to improve the load
 performance, but this job create a large table and to guarantee the data
 consistency you need to transform it into a regular table, and with the
 current implementation rewrite the entire heap, toast and indexes.

Don't buy that. The final target relation will usually already have
content. Also everything but wal_level=minimal will force you to WAL log
the contents anyway.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers