[HACKERS] Usage of planner_ctx

2012-04-24 Thread Amit Kapila
PlannerInfo-planner_ctx is assigned with either MessageContext or PortalHeapMemory depending on the flow from which planner is invoked. My doubt is that during whole planning process till the Plan is stored in PlannedStmt, all the memory is from CurrentMemoryContext which is same as

Re: [HACKERS] [BUG] Checkpointer on hot standby runs without looking checkpoint_segments

2012-04-24 Thread Kyotaro HORIGUCHI
Hello,  - xlog.c: Make StandbyMode shared.  - checkpointer.c: Use IsStandbyMode() to check if postmaster is   under standby mode. IsStandbyMode() looks overkill to me. The standby mode flag is forcibly turned off at the end of recovery, but its change doesn't need to be shared to the

Re: [HACKERS] Gsoc2012 idea, tablesample

2012-04-24 Thread Sandro Santilli
On Mon, Apr 23, 2012 at 08:34:44PM +0300, Ants Aasma wrote: On Mon, Apr 23, 2012 at 4:37 PM, Sandro Santilli s...@keybit.net wrote: I'd love to see enhanced CTID operators, to fetch all visible tuples in a page using a tidscan.  Something like: WHERE ctid =~ '(501,*)' or a ctidrange.

Re: [HACKERS] [BUG] Checkpointer on hot standby runs without looking checkpoint_segments

2012-04-24 Thread Heikki Linnakangas
On 23.04.2012 02:59, Fujii Masao wrote: On Thu, Apr 19, 2012 at 2:20 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hello, this is new version of standby checkpoint_segments patch. Thanks for the patch! This still makes catching up in standby mode slower, as you get many

Re: [HACKERS] DOMAINs and CASTs

2012-04-24 Thread Jaime Casanova
On Tue, Nov 29, 2011 at 10:12 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Nov 29, 2011 at 11:11 AM, Jaime Casanova ja...@2ndquadrant.com wrote: On Tue, Nov 29, 2011 at 10:42 AM, Tom Lane t...@sss.pgh.pa.us wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: Robert Haas

Re: [HACKERS] [PATCH] lock_timeout and common SIGALRM framework

2012-04-24 Thread Boszormenyi Zoltan
2012-04-23 15:08 keltezéssel, Marc Cousin írta: On Mon, 2012-04-23 at 10:53 +0200, Boszormenyi Zoltan wrote: 2012-04-10 09:02 keltezéssel, Boszormenyi Zoltan írta: 2012-04-06 14:47 keltezéssel, Cousin Marc írta: On 05/04/12 08:02, Boszormenyi Zoltan wrote: 2012-04-04 21:30 keltezéssel,

Re: [HACKERS] B-tree page deletion boundary cases

2012-04-24 Thread Nikhil Sontakke
Was wondering if there's a similar bug which gets triggered while using VACUUM FULL. See for instance this thread: http://postgresql.1045698.n5.nabble.com/index-corruption-in-PG-8-3-13-td4257589.html This issue has been reported on-off from time to time and in most cases VACUUM or

Re: [HACKERS] Gsoc2012 idea, tablesample

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 08:49:26AM +0200, Sandro Santilli wrote: On Mon, Apr 23, 2012 at 08:34:44PM +0300, Ants Aasma wrote: SELECT (SELECT reservoir_sample(some_table, 50) AS samples FROM some_table WHERE ctid =~ ANY (rnd_pgtids)) FROM random_pages('some_table', 50) AS rnd_pgtids;

[HACKERS] PL/PGSQL bug in handling composite types

2012-04-24 Thread Boszormenyi Zoltan
Hi, we have found a way to make pl/pgsql throw an error for a legitimate use case that works in plain SQL. Minimal test case: create table x1 (id serial primary key, d timestamptz); create table x2 (id serial primary key, d timestamptz); insert into x2 (d) values ('now'); create type mytype as

Re: [HACKERS] PL/PGSQL bug in handling composite types

2012-04-24 Thread Boszormenyi Zoltan
2012-04-24 09:59 keltezéssel, Boszormenyi Zoltan írta: Hi, we have found a way to make pl/pgsql throw an error for a legitimate use case that works in plain SQL. Minimal test case: create table x1 (id serial primary key, d timestamptz); create table x2 (id serial primary key, d timestamptz);

Re: [HACKERS] PL/PGSQL bug in handling composite types

2012-04-24 Thread Boszormenyi Zoltan
2012-04-24 10:01 keltezéssel, Boszormenyi Zoltan írta: 2012-04-24 09:59 keltezéssel, Boszormenyi Zoltan írta: Hi, we have found a way to make pl/pgsql throw an error for a legitimate use case that works in plain SQL. Minimal test case: create table x1 (id serial primary key, d timestamptz);

Re: [HACKERS] B-tree page deletion boundary cases

2012-04-24 Thread Simon Riggs
On Sat, Apr 21, 2012 at 5:52 PM, Noah Misch n...@leadboat.com wrote: As I mentioned[1] peripherally back in November, that algorithm has been insufficient since the introduction of non-XID-bearing transactions in PostgreSQL 8.3.  Such transactions do not restrain RecentXmin.  If no running

Re: [HACKERS] ECPG FETCH readahead

2012-04-24 Thread Michael Meskes
OK, I will implement #2. Another question popped up: what to do with FETCH ALL? The current readahead window size or temporarily bumping it to say some tens of thousands can be used. We may not know how much is the all records. This, although lowers performance, saves memory. I would say

Re: [HACKERS] Gsoc2012 idea, tablesample

2012-04-24 Thread Ants Aasma
On Tue, Apr 24, 2012 at 10:31 AM, Sandro Santilli s...@keybit.net wrote: On Tue, Apr 24, 2012 at 08:49:26AM +0200, Sandro Santilli wrote: On Mon, Apr 23, 2012 at 08:34:44PM +0300, Ants Aasma wrote: SELECT (SELECT reservoir_sample(some_table, 50) AS samples    FROM some_table WHERE ctid =~

Re: [HACKERS] Foreign table scan estimates

2012-04-24 Thread Albe Laurenz
Tom Lane wrote: While playing around with ANALYZE on foreign tables, I noticed that the row count estimate for foreign scans is still initialized to 1000 even if there are statistics for the foreign table. I think that this should be improved. The attached patch illustrates my suggestion.

Re: [HACKERS] B-tree page deletion boundary cases

2012-04-24 Thread Noah Misch
On Tue, Apr 24, 2012 at 09:08:36AM +0100, Simon Riggs wrote: On Sat, Apr 21, 2012 at 5:52 PM, Noah Misch n...@leadboat.com wrote: The fix is to compare the stored XID to RecentGlobalXmin, not RecentXmin. ?We already use RecentGlobalXmin when wal_level = hot_standby. ?If no running

Re: [HACKERS] DOMAINs and CASTs

2012-04-24 Thread Robert Haas
On Tue, Apr 24, 2012 at 3:00 AM, Jaime Casanova ja...@2ndquadrant.com wrote: are we going to put this warning in this release? Done. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Dump EXTENSION sequences too

2012-04-24 Thread Robert Haas
On Thu, Apr 19, 2012 at 6:42 AM, Gianni Ciolli gianni.cio...@2ndquadrant.it wrote: currently an EXTENSION can mark some of its tables as configuration tables using pg_catalog.pg_extension_config_dump(), so that pg_dump does the right thing. I think it would be useful to mark sequences too,

Re: [HACKERS] Postgres install program files folder

2012-04-24 Thread Robert Haas
On Wed, Apr 18, 2012 at 12:00 PM, Flavio Vodzinski developer.fla...@gmail.com wrote: Hello, Windows environment, has a problem in installing postgres in the Program Files folder? I have this doubt because Windows works with locking system to this folder. This question is off-topic for

Re: [HACKERS] Usage of planner_ctx

2012-04-24 Thread Tom Lane
Amit Kapila amit.kap...@huawei.com writes: So what is the use of having PlannerInfo-planner_ctx which only contains CurrentMemoryContext? It might be clearer if you read up on the memory management in GEQO planning mode. regards, tom lane -- Sent via pgsql-hackers

Re: [HACKERS] Timsort performance, quicksort (was: Re: Memory usage during sorting)

2012-04-24 Thread Robert Haas
On Wed, Apr 18, 2012 at 9:31 PM, Peter Geoghegan pe...@2ndquadrant.com wrote: Thoughts? Interesting work. I thought about trying to code up timsort at one point, but I've been running short of round tuits. I did some quick tests of quicksort using half a million random strings. On my MacBook

Re: [HACKERS] New sync commit mode remote_write

2012-04-24 Thread Robert Haas
On Fri, Apr 20, 2012 at 3:58 PM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Apr 21, 2012 at 12:20 AM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, Apr 19, 2012 at 7:50 PM, Robert Haas robertmh...@gmail.com wrote: On 4/19/12, Jeff Janes jeff.ja...@gmail.com wrote: The work around

Re: [HACKERS] New sync commit mode remote_write

2012-04-24 Thread Jeff Janes
On Thu, Apr 19, 2012 at 11:50 AM, Robert Haas robertmh...@gmail.com wrote: On 4/19/12, Jeff Janes jeff.ja...@gmail.com wrote: The work around would be for the master to refuse to automatically restart after a crash, insisting on a fail-over instead (or a manual forcing of recovery)? I

Re: [HACKERS] Timsort performance, quicksort (was: Re: Memory usage during sorting)

2012-04-24 Thread Greg Stark
On Tue, Apr 24, 2012 at 4:17 PM, Robert Haas robertmh...@gmail.com wrote: Based on that, I'm inclined to propose rejiggering things so that the presorted-input check runs only at the top level, and not during any recursive steps. Just a thought. What about running only every nth step. Maybe

Re: [HACKERS] Timsort performance, quicksort (was: Re: Memory usage during sorting)

2012-04-24 Thread Peter Geoghegan
On 24 April 2012 16:17, Robert Haas robertmh...@gmail.com wrote:  If they are in sorted order with an empty string appended onto the end, it takes about 25 seconds. That's exactly what I'd have expected, but was surprised to have not found with my own test. Perhaps it was same kind of fluke

[HACKERS] Welcome 2012 GSOC students

2012-04-24 Thread Josh Berkus
Hackers, We've chosen the 5 GSOC projects for this year: * JDBC Foreign Data Wrapper, by Atri, mentored by Merlin Moncure * Document Collection Foreign Data Wrapper, by Zheng Yang (a returning student), mentored by Satoshi Nagayasu * Implementing TABLESAMPLE, by Qi, mentored by Stephen Frost *

Re: [HACKERS] [BUG] Checkpointer on hot standby runs without looking checkpoint_segments

2012-04-24 Thread Fujii Masao
On Tue, Apr 24, 2012 at 3:53 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 23.04.2012 02:59, Fujii Masao wrote: On Thu, Apr 19, 2012 at 2:20 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp  wrote: Hello, this is new version of standby checkpoint_segments patch.

Re: [HACKERS] [BUG] Checkpointer on hot standby runs without looking checkpoint_segments

2012-04-24 Thread Fujii Masao
On Tue, Apr 24, 2012 at 3:47 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hello,  - xlog.c: Make StandbyMode shared.  - checkpointer.c: Use IsStandbyMode() to check if postmaster is   under standby mode. IsStandbyMode() looks overkill to me. The standby mode flag is

Re: [HACKERS] Welcome 2012 GSOC students

2012-04-24 Thread Atri Sharma
On Tue, Apr 24, 2012 at 10:36 PM, Josh Berkus j...@agliodbs.com wrote: Hackers, We've chosen the 5 GSOC projects for this year: * JDBC Foreign Data Wrapper, by Atri, mentored by Merlin Moncure * Document Collection Foreign Data Wrapper, by Zheng Yang (a returning student), mentored by

[HACKERS] remove dead ports?

2012-04-24 Thread Peter Eisentraut
I propose that we remove support for the following OS ports from our source tree. They are totally dead, definitely don't work, and/or probably no one remembers what they even were. The code just bit rots and is in the way of future improvements. * Dead/remove: dgux nextstep sunos4 svr4

Re: [HACKERS] remove dead ports?

2012-04-24 Thread Stefan Kaltenbrunner
On 04/24/2012 08:29 PM, Peter Eisentraut wrote: I propose that we remove support for the following OS ports from our source tree. They are totally dead, definitely don't work, and/or probably no one remembers what they even were. The code just bit rots and is in the way of future

Re: [HACKERS] 9.3: summary of corruption detection / checksums / CRCs discussion

2012-04-24 Thread Robert Haas
On Sat, Apr 21, 2012 at 5:40 PM, Jeff Davis pg...@j-davis.com wrote: * In addition to detecting random garbage, we also need to be able to detect zeroing of pages. Right now, a zero page is not considered corrupt, so that's a problem. We'll need to WAL table extension operations, and we'll

Re: [HACKERS] 9.3: summary of corruption detection / checksums / CRCs discussion

2012-04-24 Thread Robert Haas
On Sat, Apr 21, 2012 at 7:08 PM, Greg Stark st...@mit.edu wrote: The earlier consensus was to move all the hint bits to a dedicated area and exclude them from the checksum. I think double-write buffers seem to have become more fashionable but a summary that doesn't describe the former is

Re: [HACKERS] remove dead ports?

2012-04-24 Thread Robert Haas
On Tue, Apr 24, 2012 at 2:29 PM, Peter Eisentraut pete...@gmx.net wrote: I propose that we remove support for the following OS ports from our source tree.  They are totally dead, definitely don't work, and/or probably no one remembers what they even were.  The code just bit rots and is in the

Re: [HACKERS] New sync commit mode remote_write

2012-04-24 Thread Robert Haas
On Tue, Apr 24, 2012 at 12:21 PM, Jeff Janes jeff.ja...@gmail.com wrote: On Thu, Apr 19, 2012 at 11:50 AM, Robert Haas robertmh...@gmail.com wrote: On 4/19/12, Jeff Janes jeff.ja...@gmail.com wrote: The work around would be for the master to refuse to automatically restart after a crash,

Re: [HACKERS] Timsort performance, quicksort (was: Re: Memory usage during sorting)

2012-04-24 Thread Robert Haas
On Tue, Apr 24, 2012 at 12:30 PM, Greg Stark st...@mit.edu wrote: On Tue, Apr 24, 2012 at 4:17 PM, Robert Haas robertmh...@gmail.com wrote: Based on that, I'm inclined to propose rejiggering things so that the presorted-input check runs only at the top level, and not during any recursive

Re: [HACKERS] Timsort performance, quicksort (was: Re: Memory usage during sorting)

2012-04-24 Thread Robert Haas
On Tue, Apr 24, 2012 at 12:51 PM, Peter Geoghegan pe...@2ndquadrant.com wrote: On 24 April 2012 16:17, Robert Haas robertmh...@gmail.com wrote:  If they are in sorted order with an empty string appended onto the end, it takes about 25 seconds. That's exactly what I'd have expected, but was

Re: [HACKERS] Timsort performance, quicksort (was: Re: Memory usage during sorting)

2012-04-24 Thread Robert Haas
On Tue, Apr 24, 2012 at 7:16 PM, Peter Geoghegan pe...@2ndquadrant.com wrote: That makes sense to me, but obviously more data is needed here. What more data do you think is needed?  I've been suspicious of that code since the first time I looked at it, and I'm now fairly well convinced that

Re: [HACKERS] 9.3: summary of corruption detection / checksums / CRCs discussion

2012-04-24 Thread Greg Stark
On Tue, Apr 24, 2012 at 9:40 PM, Robert Haas robertmh...@gmail.com wrote:  For three things, index pages have hint-type changes that are not single-bit changes. ? Just how big are these? Part of the reason hint bit updates are safe is because one bit definitely absolutely has to be entirely in

Re: [HACKERS] remove dead ports?

2012-04-24 Thread Greg Stark
On Tue, Apr 24, 2012 at 9:49 PM, Robert Haas robertmh...@gmail.com wrote:  I'm suspicious of s_lock.h's support for National Semiconductor 32K, Renesas' M32R, Renesas' SuperH, UNIVEL, SINIX / Reliant UNIX, Nextstep, and Sun3 Were there ever multiprocessor Nextstep or Sun3 machines anyways?

Re: [HACKERS] 9.3: summary of corruption detection / checksums / CRCs discussion

2012-04-24 Thread Josh Berkus
On 4/21/12 2:40 PM, Jeff Davis wrote: If we do use WAL for hint bit updates, that has an impact on Hot Standby, because HS can't write WAL. So, it would seem that HS could not set hint bits. If we're WAL-logging hint bits, then the standby would be receiving them, so it doesn't *need* to write

[HACKERS] Temporary tables under hot standby

2012-04-24 Thread Noah Misch
A key barrier to migrations from trigger-based replication to WAL-based replication is the lack of temporary tables under hot standby. I'd like to close that gap; the changes needed will also reduce the master-side cost of temporary table usage. Here is a high-level design for your advice and

Re: [HACKERS] remove dead ports?

2012-04-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I have no position on whether those operating systems are dead enough to warrant removing support, but on a related point, I would like it if we could get rid of as many spinlock implementations as are applicable only to platforms that are effectively

Re: [HACKERS] Welcome 2012 GSOC students

2012-04-24 Thread Qi Huang
Thanks for the hackers' support. The discussion on the mailing is quite encouraging. Expecting to enjoy the 3 months' fun with Postgres. I'm still under the final period of my university, will participate more after the exams finish. Thanks! Sent from my Windows Phone