Re: Transitive Closure and 'pg_inherits'

Lists: pgsql-hackerspgsql-patches
From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: contrib/pg_buffercache
Date: 2005-03-16 02:50:32
Message-ID: 1176.24.211.165.134.1110941432.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


... is apparently broken for Windows and Cygwin. See for example
http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&dt=2005-03-16%2001:55:33
cheers

andrew


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/pg_buffercache
Date: 2005-03-16 05:23:07
Message-ID: 4237C2BB.3000603@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
> ... is apparently broken for Windows and Cygwin. See for example
> http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&dt=2005-03-16%2001:55:33
> cheers

hmmm - never tried to compile it on win32! I am getting http 502 from
the above url, so I will have a go at building on win32 tomorrow.

cheers

Mark


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/pg_buffercache
Date: 2005-03-16 08:47:31
Message-ID: 4237F2A3.7060500@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
> ... is apparently broken for Windows and Cygwin. See for example
> http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&dt=2005-03-16%2001:55:33
>

Andrew,

The attached patch seems to sort it for me, can you give it try on win32
and cygwin?

cheers

Mark

Attachment Content-Type Size
pg_buffercache_pages.c.patch text/plain 366 bytes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/pg_buffercache
Date: 2005-03-16 16:23:08
Message-ID: 42385D6C.9050806@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


It fixes the build error on Windows - haven't tried because i don't have
time, but I know it won't work on Cygwin, because WIN32 isn't (usually)
defined on Cygwin - see previous almost endless discussions.

cheers

andrew

Mark Kirkwood wrote:

> Andrew Dunstan wrote:
>
>> ... is apparently broken for Windows and Cygwin. See for example
>> http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&dt=2005-03-16%2001:55:33
>>
>>
>
> Andrew,
>
> The attached patch seems to sort it for me, can you give it try on
> win32 and cygwin?
>
> cheers
>
> Mark
>
>------------------------------------------------------------------------
>
>--- pg_buffercache_pages.c.orig Sun Mar 13 04:36:24 2005
>+++ pg_buffercache_pages.c Wed Mar 16 20:57:52 2005
>@@ -17,6 +17,11 @@
>
> #define NUM_BUFFERCACHE_PAGES_ELEM 6
>
>+#ifdef WIN32
>+extern DLLIMPORT BufferDesc *BufferDescriptors;
>+extern DLLIMPORT volatile uint32 InterruptHoldoffCount;
>+#endif
>+
>
> /*
> * Record structure holding the to be exposed cache data.
>
>
>------------------------------------------------------------------------
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib/pg_buffercache
Date: 2005-03-17 00:47:20
Message-ID: 4238D398.1080708@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
> It fixes the build error on Windows - haven't tried because i don't have
> time, but I know it won't work on Cygwin, because WIN32 isn't (usually)
> defined on Cygwin - see previous almost endless discussions.
>

Yes - I recall that discussion a while ago.

This patch should sort the issue.

One question, should I be using defined(__MINGW32__) as opposed to
defined(WIN32)? I figured I didn't as in this case it is not necessary
to distinguish between native and cygwin.

regards

Mark

Attachment Content-Type Size
pg_buffercache_pages.h.diff text/plain 472 bytes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib/pg_buffercache
Date: 2005-03-17 01:20:10
Message-ID: 4238DB4A.6010500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Mark Kirkwood wrote:

> Andrew Dunstan wrote:
>
>> It fixes the build error on Windows - haven't tried because i don't have
>> time, but I know it won't work on Cygwin, because WIN32 isn't (usually)
>> defined on Cygwin - see previous almost endless discussions.
>>
>
> Yes - I recall that discussion a while ago.
>
> This patch should sort the issue.
>
> One question, should I be using defined(__MINGW32__) as opposed to
> defined(WIN32)? I figured I didn't as in this case it is not necessary
> to distinguish between native and cygwin.
>
>

You figured correctly.

cheers

andrew


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/pg_buffercache
Date: 2005-03-17 02:53:18
Message-ID: 4238F11E.2090405@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
>
> Mark Kirkwood wrote:
>
>
>>Andrew Dunstan wrote:
>>
>>
>>>It fixes the build error on Windows - haven't tried because i don't have
>>>time, but I know it won't work on Cygwin, because WIN32 isn't (usually)
>>>defined on Cygwin - see previous almost endless discussions.
>>>
>>
>>Yes - I recall that discussion a while ago.
>>
>>This patch should sort the issue.
>>
>>One question, should I be using defined(__MINGW32__) as opposed to
>>defined(WIN32)? I figured I didn't as in this case it is not necessary
>>to distinguish between native and cygwin.
>>
>>
>
>
> You figured correctly.
>

Oh, and thanks to your efforts with the automated build system this gets
picked up now instead of lurking till after release - great work!

cheers

Mark


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Cc: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-30 19:40:11
Message-ID: 424B009B.50307@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


I have confirmed that the attached patch works on Cygwin as well as
Windows. Please apply.

cheers

andrew

Andrew Dunstan wrote:

>It fixes the build error on Windows - haven't tried because i don't have
>time, but I know it won't work on Cygwin, because WIN32 isn't (usually)
>defined on Cygwin - see previous almost endless discussions.
>
>cheers
>
>andrew
>
>Mark Kirkwood wrote:
>
>
>
>>Andrew Dunstan wrote:
>>
>>
>>
>>>... is apparently broken for Windows and Cygwin. See for example
>>>http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&dt=2005-03-16%2001:55:33
>>>
>>>
>>>
>>>
>>Andrew,
>>
>>The attached patch seems to sort it for me, can you give it try on
>>win32 and cygwin?
>>
>>cheers
>>
>>Mark
>>
>>
>>
>
>

Attachment Content-Type Size
buffercache.patch text/x-patch 743 bytes

From: Neil Conway <neilc(at)samurai(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>, Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-31 00:45:47
Message-ID: 424B483B.9070304@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
> I have confirmed that the attached patch works on Cygwin as well as
> Windows. Please apply.

Applied, thanks.

-Neil


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-31 04:52:27
Message-ID: 424B820B.4030808@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Neil Conway wrote:
> Andrew Dunstan wrote:
>
>> I have confirmed that the attached patch works on Cygwin as well as
>> Windows. Please apply.
>
>
> Applied, thanks.
>

Great that it fixes it... however, I had submitted a tidier patch that
puts the macro in the header (probably after asking Andrew to test the
first one, oops - sorry Andrew). I have tested it on win32 native.

Do you want to back out the first one and use this instead?

regards

Mark

Attachment Content-Type Size
pg_buffercache_pages.h.diff text/plain 472 bytes

From: Neil Conway <neilc(at)samurai(dot)com>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-31 06:56:52
Message-ID: 424B9F34.6090802@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Mark Kirkwood wrote:
> Great that it fixes it... however, I had submitted a tidier patch that
> puts the macro in the header

How is this tidier?

(I don't see a reason for pg_buffercache_pages.h at all, actually.)

-Neil


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-31 08:25:32
Message-ID: 424BB3FC.30907@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Neil Conway wrote:
> Mark Kirkwood wrote:
>
>> Great that it fixes it... however, I had submitted a tidier patch that
>> puts the macro in the header
>
>
> How is this tidier?
>

err... puts the macro in the header....

> (I don't see a reason for pg_buffercache_pages.h at all, actually.)
>
(chuckles) - well, that puts a different complexion on it, best leave it
as is then! (in fact, feel free to move the declaration from
pg_buffercache_pages.h to pg_buffercache_pages.c, and eliminate the
header altogether)

cheers

Mark


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: Neil Conway <neilc(at)samurai(dot)com>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-31 12:31:44
Message-ID: 424BEDB0.6090706@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Mark Kirkwood wrote:

> Neil Conway wrote:
>
>> Andrew Dunstan wrote:
>>
>>> I have confirmed that the attached patch works on Cygwin as well as
>>> Windows. Please apply.
>>
>>
>>
>> Applied, thanks.
>>
>
>
> Great that it fixes it... however, I had submitted a tidier patch that
> puts the macro in the header (probably after asking Andrew to test the
> first one, oops - sorry Andrew). I have tested it on win32 native.
>
> Do you want to back out the first one and use this instead?
>
>
>

I didn't see the original of the later patch, which is why I sent in
mine. I honestly don't care that much either way, although I'm inclined
to agree that the header file is just unnecessary noise.

cheers

andrew


From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-03-31 23:41:19
Message-ID: 424C8A9F.6090106@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
>
> I didn't see the original of the later patch, which is why I sent in
> mine. I honestly don't care that much either way, although I'm inclined
> to agree that the header file is just unnecessary noise.
>

Well, looks like a strong feeling for no header :-). I didn't really
think about *not* having one to be honest. So, anyway - instead of
inviting Neil to spend valuable time eliminating it, I should do it
myself...

So, please ignore my previous patch to the header file, and consider
this one - which eliminates it completely.

best wishes

Mark

Attachment Content-Type Size
pg_buffercache-noheader.patch text/plain 1.5 KB

From: Neil Conway <neilc(at)samurai(dot)com>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] contrib/pg_buffercache
Date: 2005-04-01 08:41:41
Message-ID: 424D0945.90205@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Mark Kirkwood wrote:
> So, please ignore my previous patch to the header file, and consider
> this one - which eliminates it completely.

Thanks, applied.

-Neil


From: Ioannis Theoharis <theohari(at)ics(dot)forth(dot)gr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Transitive Closure and 'pg_inherits'
Date: 2005-04-03 14:45:56
Message-ID: Pine.GSO.4.58.0504031734500.5404@ourania.ics.forth.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Hi,

in case one use 'inherits' relationship to create a hierarchy of
tables, table 'pg_inherits' stores for each table the information of which
is its parent table.

During the evaluation of a query like
select * from Root;
where Root is the 'root' table of our hierarchy, postgreSQL needs to
find which tables are involved in the result (which tables belong to the
hierarchy).

My question is whether the way, in wich postgresql do this task, is a
transitive closure on table 'pg_inherits' or there is a better approach
implemented (like numbering scheme techniques etc.) ?

If there is a related url, please send it to me.


From: Ioannis Theoharis <theohari(at)ics(dot)forth(dot)gr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Recursive SQL
Date: 2005-04-03 17:02:27
Message-ID: Pine.GSO.4.58.0504032000400.5510@ourania.ics.forth.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Also i'd like to answer you if postgresQL has implemented rcursive queries
proposed from SQL99 standard?

If yes, are there any restrictions of the model on your implementation?


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ioannis Theoharis <theohari(at)ics(dot)forth(dot)gr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transitive Closure and 'pg_inherits'
Date: 2005-04-03 17:13:09
Message-ID: 11594.1112548389@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Ioannis Theoharis <theohari(at)ics(dot)forth(dot)gr> writes:
> My question is whether the way, in wich postgresql do this task, is a
> transitive closure on table 'pg_inherits' or there is a better approach
> implemented (like numbering scheme techniques etc.) ?

It's a transitive closure, and not a very bright one at that; see
find_all_inheritors(), find_inheritance_children(), and particularly
the comments to the latter. However, we've not heard reports indicating
that this is a serious bottleneck in any real-world situation, so
no one has spent time to improve it. (I'd expect the per-table planning
costs to vastly outweigh the cost of finding those tables, anyway.)

regards, tom lane