Re: [HACKERS] extend pgbench expressions with functions

2016-03-27 Thread Fabien COELHO
v40 is yet another rebase. -- Fabien.diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index c6d1454..4ceddae 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -815,9 +815,10 @@ pgbench options dbname - Sets variable

Re: [HACKERS] Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c

2016-03-27 Thread Piotr Stefaniak
On 2016-03-26 19:29, Piotr Stefaniak wrote: I'm not saying this is necessarily a bug since the whole function deals with floats, but perhaps it's interesting to note that ndistinct can be 0 in src/backend/utils/adt/selfuncs.c:estimate_hash_bucketsize: On the exact same note, something like this

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Alexander Korotkov
On Sat, Mar 26, 2016 at 1:26 AM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > Thank you very much for testing! > I also got access to 4 x 18 Intel server with 144 threads. I'm going to > post results of tests on this server in next Monday. > I've run pgbench tests on this machine: pgb

Re: [HACKERS] Relation extension scalability

2016-03-27 Thread Dilip Kumar
On Sat, Mar 26, 2016 at 3:18 PM, Dilip Kumar wrote: > search the last, say, two pages of the FSM in all cases. But that >> might be expensive. The extra call to RelationGetNumberOfBlocks seems >> cheap enough here because the alternative is to wait for a contended >> heavyweight lock. >> > > I w

Re: [HACKERS] Relation extension scalability

2016-03-27 Thread Dilip Kumar
On Sat, Mar 26, 2016 at 3:18 PM, Dilip Kumar wrote: > We could go further still and have GetPageWithFreeSpace() always >> search the last, say, two pages of the FSM in all cases. But that >> might be expensive. The extra call to RelationGetNumberOfBlocks seems >> cheap enough here because the al

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Andres Freund
On 2016-03-25 23:02:11 +0530, Dilip Kumar wrote: > On Fri, Mar 25, 2016 at 8:09 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > > > Could anybody run benchmarks? Feature freeze is soon, but it would be > > *very nice* to fit it into 9.6 release cycle, because it greatly improves >

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Andres Freund
On 2016-03-27 12:38:25 +0300, Alexander Korotkov wrote: > On Sat, Mar 26, 2016 at 1:26 AM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > > > Thank you very much for testing! > > I also got access to 4 x 18 Intel server with 144 threads. I'm going to > > post results of tests on this s

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Dilip Kumar
On Sun, Mar 27, 2016 at 5:37 PM, Andres Freund wrote: > On what hardware did you run these tests? IBM POWER 8 MACHINE. Architecture: ppc64le Byte Order:Little Endian CPU(s):192 Thread(s) per core:8 Core(s) per socket:1 Socket(s):

Re: [HACKERS] Performance degradation in commit 6150a1b0

2016-03-27 Thread Andres Freund
Hi, On 2016-03-27 02:34:32 +0530, Ashutosh Sharma wrote: > As mentioned in my earlier mail i was not able to apply > *pinunpin-cas-5.patch* on commit *6150a1b0, That's not surprising; that's pretty old. > *therefore i thought of applying it on the latest commit and i was > able to do it successf

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Andres Freund
On 2016-03-27 17:45:52 +0530, Dilip Kumar wrote: > On Sun, Mar 27, 2016 at 5:37 PM, Andres Freund wrote: > > > On what hardware did you run these tests? > > > IBM POWER 8 MACHINE. > > Architecture: ppc64le > Byte Order:Little Endian > CPU(s):192 > Threa

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-27 Thread Emre Hasegeli
>>> I'll try to explain with two-dimensional example over points. ASCII-art: >> >> Thank you for the explanation. Should we incorporate this with the patch. > > added I have worked on the comments of the patch. It is attached. I hope it looks more clear than it was before. >>> + cmp_double(con

Re: [HACKERS] Alter or rename enum value

2016-03-27 Thread Andrew Dunstan
On 03/27/2016 12:43 AM, Christophe Pettus wrote: On Mar 26, 2016, at 7:40 AM, Andrew Dunstan wrote: It would be nice if we could find a less broad brush approach to dealing with the issue. I don't know how doable this is, but could we use the existing mechanism of marking an index invalid

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Alexander Korotkov
On Sun, Mar 27, 2016 at 3:10 PM, Andres Freund wrote: > On 2016-03-27 12:38:25 +0300, Alexander Korotkov wrote: > > On Sat, Mar 26, 2016 at 1:26 AM, Alexander Korotkov < > > a.korot...@postgrespro.ru> wrote: > > > > > Thank you very much for testing! > > > I also got access to 4 x 18 Intel server

Re: [HACKERS] Alter or rename enum value

2016-03-27 Thread Tom Lane
Andrew Dunstan writes: > The more I think about this the more I bump up against the fact that > almost anything we do might want to do to ameliorate the situation is > going to be rolled back. The only approach I can think of that doesn't > suffer from this is to abort if an insert/update will

Re: [HACKERS] AssertArg failure in src/backend/executor/functions.c:check_sql_fn_retval()

2016-03-27 Thread Tom Lane
Piotr Stefaniak writes: > using sqlsmith I found a way to induce an AssertArg failure in > src/backend/executor/functions.c:check_sql_fn_retval() for > assert-enabled builds. It boils down to creating a function and calling > it like this: > CREATE FUNCTION bad_argument_assert(anyarray, intege

Re: [HACKERS] GinPageIs* don't actually return a boolean

2016-03-27 Thread Andres Freund
On 2016-03-18 14:36:23 +0300, Yury Zhuravlev wrote: > Robert Haas wrote: > >On Wed, Mar 2, 2016 at 9:48 PM, Peter Eisentraut wrote: > >>On 2/11/16 9:30 PM, Michael Paquier wrote: ... > > > >We need to decide what to do about this. I disagree with Peter: I > >think that regardless of stdbool, what

Re: [HACKERS] Alter or rename enum value

2016-03-27 Thread Christophe Pettus
On Mar 27, 2016, at 7:20 AM, Tom Lane wrote: > I do not know whether this would be a meaningful improvement for > common use-cases, though. It would certainly be a step forward over the current situation. It would mean that a specific imaginable use-case (inserting a new enum value, then popu

[HACKERS] [PATCH] Alter or rename enum value

2016-03-27 Thread Dagfinn Ilmari Mannsåker
ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > I was bored and thought "how hard could it be?", and a few hours' > hacking later, I have something that seems to work. It doesn't do IF > NOT EXISTS yet, and the error messaging could do with some improvement, > and there are no docs. The p

Re: [HACKERS] [PATCH] Alter or rename enum value

2016-03-27 Thread Marko Tiikkaja
On 2016-03-27 19:30, Dagfinn Ilmari Mannsåker wrote: ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: I was bored and thought "how hard could it be?", and a few hours' hacking later, I have something that seems to work. It doesn't do IF NOT EXISTS yet, and the error messaging could do with

Re: [HACKERS] [PATCH] Alter or rename enum value

2016-03-27 Thread Dagfinn Ilmari Mannsåker
Marko Tiikkaja writes: > On 2016-03-27 19:30, Dagfinn Ilmari Mannsåker wrote: >> ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: >> >>> I was bored and thought "how hard could it be?", and a few hours' >>> hacking later, I have something that seems to work. It doesn't do IF >>> NOT EXISTS y

Re: [HACKERS] AssertArg failure in src/backend/executor/functions.c:check_sql_fn_retval()

2016-03-27 Thread Piotr Stefaniak
On 2016-03-27 16:40, Tom Lane wrote: Hm. I would argue that it should have rejected CAST(NULL AS ANYARRAY). That's a pseudotype and so there should never be an actual value of that type, not even a null value. I'm a little confused about what you mean here. I thought reject was exactly what's

Re: [HACKERS] Relation extension scalability

2016-03-27 Thread Robert Haas
On Sun, Mar 27, 2016 at 8:00 AM, Dilip Kumar wrote: > Relation Size > - > INSERT : 16000 transaction from 32 Client > > Base v13 v14_1 > - - > TPS 37 255

[HACKERS] Automatically add -Wold-style-definition?

2016-03-27 Thread Andres Freund
Hi, Does somebody see a reason not to automatically detect and use -Wold-style-definition? Per e.g. http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=9f7c527af308dcdaba2f0ff9d362d672e8886fb1 that'd be useful, and it's an easy to make and automatically detect mistake; and it doesn

[HACKERS] Sync timezone code with upstream release tzcode2016c

2016-03-27 Thread Tom Lane
Well, that was just about as tedious as I feared it might be, but attached is a patch for $SUBJECT. We should apply this, and probably eventually back-patch it, but it'd be wise to let it age awhile in HEAD first. Is anyone interested in reviewing it, or shall I just push it and see what the buil

Re: [HACKERS] Automatically add -Wold-style-definition?

2016-03-27 Thread Tom Lane
Andres Freund writes: > Does somebody see a reason not to automatically detect and use > -Wold-style-definition? +1 ... unless we have some that are that way intentionally, which I kinda doubt, but you could soon find out. regards, tom lane -- Sent via pgsql-hackers ma

Re: [HACKERS] Automatically add -Wold-style-definition?

2016-03-27 Thread Andres Freund
On 2016-03-27 17:16:11 -0400, Tom Lane wrote: > Andres Freund writes: > > Does somebody see a reason not to automatically detect and use > > -Wold-style-definition? > > +1 ... unless we have some that are that way intentionally, which > I kinda doubt, but you could soon find out. We don't, I've

Re: [HACKERS] pg_rewind just doesn't fsync *anything*?

2016-03-27 Thread Andres Freund
On 2016-03-09 19:43:52 -0800, Andres Freund wrote: > Hi, > > how come that the only comment in pg_rewind about fsyncing is ' > void > close_target_file(void) > { > ... > /* fsync? */ > } > > Isn't that a bit, uh, minimal for a utility that's likely to be used in > failover scenarios? > > I

Re: [HACKERS] Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c

2016-03-27 Thread Tom Lane
Piotr Stefaniak writes: > I'm not saying this is necessarily a bug since the whole function deals > with floats, but perhaps it's interesting to note that ndistinct can be > 0 in src/backend/utils/adt/selfuncs.c:estimate_hash_bucketsize: I think it's basically cosmetic unless you've got a machi

Re: [HACKERS] Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c

2016-03-27 Thread Tom Lane
Piotr Stefaniak writes: > On the exact same note, something like this (again reduced from what > sqlsmith produced): > leads to vardata.rel->tuples being zero here: > if (vardata.rel) > ndistinct *= vardata.rel->rows / vardata.rel->tuples; Ugh. That's a bit worse because it'

Re: [HACKERS] silent data loss with ext4 / all current versions

2016-03-27 Thread Andres Freund
Hi, On 2016-03-18 15:08:32 +0900, Michael Paquier wrote: > +/* > + * Sync data directory to ensure that what has been generated up to now is > + * persistent in case of a crash, and this is done once globally for > + * performance reasons as sync requests on individual files would be > + * a negat

[HACKERS] backup tools ought to ensure created backups are durable

2016-03-27 Thread Andres Freund
Hi, As pointed out in http://www.postgresql.org/message-id/20160327232509.v5wgac5vskuse...@awork2.anarazel.de our backup tools (i.e. pg_basebackup, pg_dump[all]), currently don't make any efforts to ensure their output is durable. I think for backup tools of possibly critical data, that's pretty

Re: [HACKERS] pg_rewind just doesn't fsync *anything*?

2016-03-27 Thread Michael Paquier
On Mon, Mar 28, 2016 at 6:52 AM, Andres Freund wrote: > I've pushed a modified version of the fix that Michael posted in > http://archives.postgresql.org/message-id/CAB7nPqRmM%2BCX6bVxw0Y7mMVGMFj1S8kwhevt8TaP83yeFRfbXA%40mail.gmail.com Thanks. -- Michael -- Sent via pgsql-hackers mailing list

Re: [HACKERS] backup tools ought to ensure created backups are durable

2016-03-27 Thread Michael Paquier
On Mon, Mar 28, 2016 at 8:30 AM, Andres Freund wrote: > As pointed out in > http://www.postgresql.org/message-id/20160327232509.v5wgac5vskuse...@awork2.anarazel.de > our backup tools (i.e. pg_basebackup, pg_dump[all]), currently don't > make any efforts to ensure their output is durable. > > I thi

Re: [HACKERS] Relation extension scalability

2016-03-27 Thread Dilip Kumar
On Mon, Mar 28, 2016 at 1:55 AM, Robert Haas wrote: > > One is like below--> > > - > > In AddExtraBlock > > { > >I add page to FSM one by one like v13 does. > >then update the full FSM tree up till root > > } > > Not following this. Did you attach this version? >

Re: [HACKERS] VS 2015 support in src/tools/msvc

2016-03-27 Thread Michael Paquier
On Fri, Mar 25, 2016 at 9:48 PM, Andrew Dunstan wrote: > OK, sounds good. Just a side-note. Andres has pushed the fix for the GinIs* macros as af4472bc, making patch 0003 from the last series useless now. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] Draft release notes for next week's releases

2016-03-27 Thread Peter Geoghegan
On Sat, Mar 26, 2016 at 4:34 PM, Tom Lane wrote: > Probably the most discussion-worthy item is whether we can say > anything more about the strxfrm mess. Should we make a wiki > page about that and have the release note item link to it? I think that there is an argument against doing so, which i

Re: [HACKERS] Draft release notes for next week's releases

2016-03-27 Thread David G. Johnston
On Sun, Mar 27, 2016 at 8:43 PM, Peter Geoghegan wrote: > On Sat, Mar 26, 2016 at 4:34 PM, Tom Lane wrote: > > Probably the most discussion-worthy item is whether we can say > > anything more about the strxfrm mess. Should we make a wiki > > page about that and have the release note item link t

[HACKERS] Nested funtion

2016-03-27 Thread Sridhar N Bamandlapally
Hi Is there any way to create nested function? oracle to postgres migration required super function variable reference into nested function without nested function parameter Oracle sample: --- create or replace function f1(n number) return number is vs number:=1;

Re: [HACKERS] Nested funtion

2016-03-27 Thread Pavel Stehule
Hi 2016-03-28 6:14 GMT+02:00 Sridhar N Bamandlapally : > Hi > > Is there any way to create nested function? > Some languages supports this feature, like plv8, but plpgsql doesn't support it, You have to use two function and some implementation of session variables. Regards Pavel > > oracle t

Re: [HACKERS] Nested funtion

2016-03-27 Thread David G. Johnston
On Sun, Mar 27, 2016 at 9:14 PM, Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi > > Is there any way to create nested function? > > oracle to postgres migration required super function variable reference > into nested function without nested function parameter > > Oracle sample: > --

Re: [HACKERS] silent data loss with ext4 / all current versions

2016-03-27 Thread Michael Paquier
On Mon, Mar 28, 2016 at 8:25 AM, Andres Freund wrote: > On 2016-03-18 15:08:32 +0900, Michael Paquier wrote: >> + fprintf(stderr, _("%s: could not rename file \"%s\": %s\n"), >> + progname, current_walfile_name, >> strerror(errno)); > > current_walfile_name

Re: [HACKERS] Relation extension scalability

2016-03-27 Thread Amit Kapila
On Mon, Mar 28, 2016 at 1:55 AM, Robert Haas wrote: > > On Sun, Mar 27, 2016 at 8:00 AM, Dilip Kumar wrote: > > > Results: > > -- > > 1. With this performance is little less than v14 but the problem of extra > > relation size is solved. > > 2. With this we can conclude that extra size of

Re: [HACKERS] Relation extension scalability

2016-03-27 Thread Dilip Kumar
On Mon, Mar 28, 2016 at 11:00 AM, Amit Kapila wrote: > I have not debugged the flow, but by looking at v13 code, it looks like it > will search both old and new. In > function > GetPageWithFreeSpaceExtended()->fsm_search_from_addr()->fsm_search_avail(), > the basic idea of search is: Start the

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Dilip Kumar
On Sun, Mar 27, 2016 at 5:48 PM, Andres Freund wrote: > > What's sizeof(BufferDesc) after applying these patches? It should better > be <= 64... > It is 72. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com