Re: [HACKERS] Additional LWLOCK_STATS statistics

2015-12-20 Thread Jesper Pedersen
On 12/18/2015 01:16 PM, Robert Haas wrote: Is this just for informational purposes, or is this something you are looking to have committed? I originally thought the former, but now I'm wondering if I misinterpreted your intent. I have a hard time getting excited about committing something that

Re: [HACKERS] Threads in PostgreSQL

2015-12-20 Thread Konstantin Knizhnik
Hi, PostgreSQL is not using threads but it is possible to spawn thread in your PostgreSQL extensions. For example, I have used pool of threads in my IMCS extension. But you need to build your extension with -pthread: CUSTOM_COPT = -pthread Also, please take in account that many PostgreSQL fu

Re: [HACKERS] Parallel Aggregate

2015-12-20 Thread David Rowley
On 21 December 2015 at 17:23, Haribabu Kommi wrote: > > Attached latest performance report. Parallel aggregate is having some > overhead > in case of low selectivity.This can be avoided with the help of cost > comparison > between normal and parallel aggregates. > > Hi, Thanks for posting an upda

Re: [HACKERS] Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

2015-12-20 Thread Michael Paquier
On Sat, Dec 12, 2015 at 8:29 PM, Michael Paquier wrote: > On Sat, Dec 12, 2015 at 11:37 AM, Noah Misch wrote: >> On Fri, Dec 11, 2015 at 09:34:34PM +0900, Michael Paquier wrote: >>> On Fri, Dec 11, 2015 at 8:48 PM, Alvaro Herrera >>> wrote: >>> > Michael Paquier wrote: >>> >> On Fri, Dec 11, 201

Re: [HACKERS] Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby

2015-12-20 Thread Michael Paquier
On Sun, Dec 20, 2015 at 10:14 PM, Michael Paquier wrote: > Speaking of which, this patch was registered in this CF, I am moving > it to the next as a bug fix. I found a stupid bug in my previous patch: when issuing XLOG_SWITCH it is possible that the return LSN pointer is on the new segment that

Re: [HACKERS] Threads in PostgreSQL

2015-12-20 Thread Chapman Flack
On 12/21/15 01:24, Atri Sharma wrote: > On Mon, Dec 21, 2015, sri harsha wrote: > >> I am using threads in my >> foreign data wrapper and i get the following error when i use the threads . >> >> *ERROR: stack depth limit exceeded* >> *HINT: Increase the configuration parameter "max_stack_depth"

Re: [HACKERS] Tab completion for ALTER COLUMN SET STATISTICS

2015-12-20 Thread Michael Paquier
On Mon, Dec 21, 2015 at 3:34 PM, Jeff Janes wrote: > On Tue, Dec 1, 2015 at 10:37 PM, Michael Paquier > wrote: >> >> With the refactoring of tab-complete.c that is moving on, perhaps this >> entry should be moved to next CF. Thoughts? > > The now-committed tab-complete.c refactoring renders this

Re: [HACKERS] Tab completion for ALTER COLUMN SET STATISTICS

2015-12-20 Thread Jeff Janes
On Tue, Dec 1, 2015 at 10:37 PM, Michael Paquier wrote: > > With the refactoring of tab-complete.c that is moving on, perhaps this > entry should be moved to next CF. Thoughts? The now-committed tab-complete.c refactoring renders this unnecessary, so I've marked this patch as rejected. Thanks,

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2015-12-20 Thread Amit Kapila
On Fri, Dec 18, 2015 at 9:58 PM, Robert Haas wrote: > > On Fri, Dec 18, 2015 at 1:16 AM, Amit Kapila wrote: > > >> Some random comments: > >> > >> - TransactionGroupUpdateXidStatus could do just as well without > >> add_proc_to_group. You could just say if (group_no >= NUM_GROUPS) > >> break; in

Re: [HACKERS] Threads in PostgreSQL

2015-12-20 Thread Atri Sharma
On Mon, Dec 21, 2015 at 11:51 AM, sri harsha wrote: > Hi, > >Is it possible to use threads in Postgresql ?? I am using threads in my > foreign data wrapper and i get the following error when i use the threads . > > *ERROR: stack depth limit exceeded* > *HINT: Increase the configuration para

[HACKERS] Threads in PostgreSQL

2015-12-20 Thread sri harsha
Hi, Is it possible to use threads in Postgresql ?? I am using threads in my foreign data wrapper and i get the following error when i use the threads . *ERROR: stack depth limit exceeded* *HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the pla

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2015-12-20 Thread Pavel Stehule
2015-12-21 1:06 GMT+01:00 Jim Nasby : > On 10/30/15 6:01 AM, Pavel Stehule wrote: > >> I am sending patch that enables to use references to polymorphic >> parameters of row types. Another functionality is possibility to get >> array or element type of referenced variable. It removes some gaps when

Re: [HACKERS] A typo in syncrep.c

2015-12-20 Thread Kyotaro HORIGUCHI
Hello, At Fri, 18 Dec 2015 12:44:34 -0500, Robert Haas wrote in > On Wed, Dec 16, 2015 at 3:33 AM, Kyotaro HORIGUCHI > wrote: > > Hello, I think I found a typo in a comment of syncrep.c. > > > >> * acknowledge the commit nor raise ERROR or FATAL. The latter would > >> - * lead the client to

Re: [HACKERS] [PoC] Asynchronous execution again (which is not parallel)

2015-12-20 Thread Kyotaro HORIGUCHI
Thank you for the comment. At Tue, 15 Dec 2015 21:01:27 -0500, Robert Haas wrote in > On Mon, Dec 14, 2015 at 3:34 AM, Kyotaro HORIGUCHI > wrote: > > Yes, the most significant and obvious (but hard to estimate the > > benefit) target of async execution is (Merge)Append-ForeignScan, > > which i

Re: [HACKERS] psql - -dry-run option

2015-12-20 Thread Craig Ringer
On 18 December 2015 at 16:50, Shulgin, Oleksandr < oleksandr.shul...@zalando.de> wrote: > I'm on the same line: BEGIN/ROLLBACK requires trivial effort and a > --dry-run option might give a false sense of security, but it cannot > possibly rollback side-effects of user functions which modify files

Re: [HACKERS] psql - -dry-run option

2015-12-20 Thread Jim Nasby
On 12/18/15 2:50 AM, Shulgin, Oleksandr wrote: On Thu, Dec 17, 2015 at 9:13 PM, Tom Lane mailto:t...@sss.pgh.pa.us>> wrote: Whether we really need a feature like that isn't clear though; it's not like it's hard to test things that way now. Stick in a BEGIN with no COMMIT, you're th

Re: [HACKERS] Weighted Stats

2015-12-20 Thread David Fetter
On Sun, Dec 20, 2015 at 06:13:33PM -0600, Jim Nasby wrote: > On 11/2/15 5:46 PM, David Fetter wrote: > >I'd like to add weighted statistics to PostgreSQL > > Anything happen with this? If community isn't interested, ISTM it'd be good > to put this in PGXN. I think it's already in PGXN as an exten

Re: [HACKERS] Optimizing away second VACUUM heap scan when only BRIN indexes on table

2015-12-20 Thread David Fetter
On Sun, Dec 20, 2015 at 11:14:46PM -0300, Alvaro Herrera wrote: > Jim Nasby wrote: > > On 11/23/15 5:06 PM, Peter Geoghegan wrote: > > >I realize that the second scan performed by lazy_vacuum_heap() only > > >visits those pages known to contain dead tuples. However, the > > >experience of seeing pr

Re: [HACKERS] Optimizing away second VACUUM heap scan when only BRIN indexes on table

2015-12-20 Thread Peter Geoghegan
On Sun, Dec 20, 2015 at 6:14 PM, Alvaro Herrera wrote: > Since BRIN indexes cannot be primary keys nor unique keys, it's hard to > be convinced that the use case of a table with only BRIN indexes is > terribly interesting. I'm not convinced of that. -- Peter Geoghegan -- Sent via pgsql-hacke

Re: [HACKERS] Optimizing away second VACUUM heap scan when only BRIN indexes on table

2015-12-20 Thread Alvaro Herrera
Jim Nasby wrote: > On 11/23/15 5:06 PM, Peter Geoghegan wrote: > >I realize that the second scan performed by lazy_vacuum_heap() only > >visits those pages known to contain dead tuples. However, the > >experience of seeing problems with the random sampling of ANALYZE > >makes me think that that mig

Re: [HACKERS] Typo in the comment above heap_prepare_freeze_tuple()

2015-12-20 Thread Amit Langote
On 2015/12/19 2:05, Robert Haas wrote: > On Fri, Dec 18, 2015 at 1:25 AM, Amit Langote > wrote: >> I think the following may be a typo: >> >> * Caller is responsible for ensuring that no other backend can access the >> * storage underlying this tuple, either by holding an exclusive lock on the

Re: [HACKERS] Optimizing away second VACUUM heap scan when only BRIN indexes on table

2015-12-20 Thread Jim Nasby
On 11/23/15 5:06 PM, Peter Geoghegan wrote: I realize that the second scan performed by lazy_vacuum_heap() only visits those pages known to contain dead tuples. However, the experience of seeing problems with the random sampling of ANALYZE makes me think that that might not be very helpful. There

Re: [HACKERS] Making tab-complete.c easier to maintain

2015-12-20 Thread Thomas Munro
On Sun, Dec 20, 2015 at 10:24 AM, Tom Lane wrote: > I've committed this now with a number of changes, many of them just > stylistic. Thanks! And thanks also to Michael, Kyotaro, Alvaro and Jeff. +1 for the suggested further improvements, which I will help out with where I can. -- Thomas Munro

Re: [HACKERS] Weighted Stats

2015-12-20 Thread Jim Nasby
On 11/2/15 5:46 PM, David Fetter wrote: I'd like to add weighted statistics to PostgreSQL Anything happen with this? If community isn't interested, ISTM it'd be good to put this in PGXN. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture an

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2015-12-20 Thread Jim Nasby
On 10/30/15 6:01 AM, Pavel Stehule wrote: I am sending patch that enables to use references to polymorphic parameters of row types. Another functionality is possibility to get array or element type of referenced variable. It removes some gaps when polymorphic parameters are used. Did this make

Re: [HACKERS] SET SESSION AUTHORIZATION superuser limitation.

2015-12-20 Thread Dmitry Igrishin
2015-12-20 21:47 GMT+03:00 Tom Lane : > Dmitry Igrishin writes: > > There are feature which may be useful in conjunction with connection > pools. > > It is the ability to change the session user without creating the new > > connection, like this: > > (pseudo REPL): > > notsuperuser > SELECT curre

Re: [HACKERS] SET SESSION AUTHORIZATION superuser limitation.

2015-12-20 Thread Tom Lane
Dmitry Igrishin writes: > There are feature which may be useful in conjunction with connection pools. > It is the ability to change the session user without creating the new > connection, like this: > (pseudo REPL): > notsuperuser > SELECT current_user, session_user; > notsuperuser notsuperuser >

[HACKERS] SET SESSION AUTHORIZATION superuser limitation.

2015-12-20 Thread Dmitry Igrishin
Hackers, There are feature which may be useful in conjunction with connection pools. It is the ability to change the session user without creating the new connection, like this: (pseudo REPL): notsuperuser > SELECT current_user, session_user; notsuperuser notsuperuser notsuperuser > SET SESSION AU

Re: [HACKERS] WIP: bloom filter in Hash Joins with batches

2015-12-20 Thread Tomas Vondra
Hi, On 12/20/2015 05:46 AM, Oleg Bartunov wrote: Tomas, have you seen http://www.postgresql.org/message-id/4b4dd67f.9010...@sigaev.ru I have very limited internet connection (no graphics) , so I may miss something I haven't seen that, but I don't really see how that's related - your post is

Re: [HACKERS] [PATCH] Equivalence Class Filters

2015-12-20 Thread David Fetter
On Sun, Dec 20, 2015 at 10:27:35PM +1300, David Rowley wrote: > On 16 December 2015 at 13:26, Simon Riggs wrote: > > > There is an interesting real world case where we might get some > > use of these thoughts. > > > > If we have Orders and OrderItems (FK->Orders) and we also know > > (and can Ass

Re: [HACKERS] extend pgbench expressions with functions

2015-12-20 Thread Michael Paquier
On Sat, Dec 19, 2015 at 10:32 PM, Fabien COELHO wrote: > >>> After looking again at the code, I remembered why double are useful: >>> there >>> are needed for random exponential & gaussian because the last parameter >>> is a >>> double. >>> >>> I do not care about the sqrt, but double must be allo

Re: [HACKERS] Additional role attributes && superuser review

2015-12-20 Thread Stephen Frost
Michael, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Tue, Dec 1, 2015 at 9:18 AM, Michael Paquier > wrote: > > OK, let's do so then by having this one fall under pg_backup. Let's > > not be my grunting concerns be an obstacle for this patch, and we > > could still change it afterwar

Re: [HACKERS] Additional role attributes && superuser review

2015-12-20 Thread Michael Paquier
On Tue, Dec 1, 2015 at 9:18 AM, Michael Paquier wrote: > On Tue, Dec 1, 2015 at 3:32 AM, Stephen Frost wrote: >> * Robert Haas (robertmh...@gmail.com) wrote: >>> On Fri, Nov 20, 2015 at 12:29 PM, Stephen Frost wrote: >>> > * Michael Paquier (michael.paqu...@gmail.com) wrote: >>> >> On Thu, Nov 1

Re: [HACKERS] Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby

2015-12-20 Thread Michael Paquier
On Sun, Nov 8, 2015 at 9:50 PM, Michael Paquier wrote: > On Sat, Nov 7, 2015 at 3:54 PM, Michael Paquier wrote: >> I thought about something like that at some point by saving a minimum >> activity pointer in XLogCtl, updated each time a segment was forcibly >> switched or after inserting a checkpo

Re: [HACKERS] custom function for converting human readable sizes to bytes

2015-12-20 Thread Pavel Stehule
Hi new update: 1. unit searching is case insensitive 2. initial support for binary byte prefixes - KiB, MiB, .. (IEC standard), change behave for SI units Second point is much more complex then it is looking - if pg_size_bytes should be consistent with pg_size_pretty. The current pg_size_pret

Re: [HACKERS] [PATCH] Equivalence Class Filters

2015-12-20 Thread David Rowley
On 16 December 2015 at 13:26, Simon Riggs wrote: > There is an interesting real world case where we might get some use of > these thoughts. > > If we have Orders and OrderItems (FK->Orders) > and we also know (and can Assert) Order.order_date <= OrderItems.ship_date > then a restriction on Orders