Re: postgresql shared buffers

From: Praveen Kumar N <praveen_n(at)students(dot)iiit(dot)net>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: postgresql shared buffers
Date: 2006-09-08 16:35:03
Message-ID: Pine.LNX.4.61.0609082202120.1925@students.iiit.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


one more doubt.in the following example we dont need sort right.But in
this case also relations were scanned sequentially one by one.So is it the
case that any relation is accessed only once from database while executing
a given query?

praveen=# explain select count(*) from a_9000_0,b_9000_0;
QUERY PLAN
----------------------------------------------------------------------------------
Aggregate (cost=537566595.00..537566595.01 rows=1 width=0)
-> Nested Loop (cost=7616.00..485726595.00 rows=20736000000 width=0)
-> Seq Scan on a_9000_0 (cost=0.00..6979.00 rows=144000
width=0)
-> Materialize (cost=7616.00..9549.00 rows=144000 width=0)
-> Seq Scan on b_9000_0 (cost=0.00..6979.00 rows=144000
width=0)
(5 rows)

Regards,
Praveen

On Fri, 8 Sep 2006, Heikki Linnakangas wrote:

> Date: Fri, 08 Sep 2006 15:30:37 +0100
> From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
> To: Praveen Kumar N <praveen_n(at)students(dot)iiit(dot)net>
> Cc: pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] postgresql shared buffers
>
> Praveen Kumar N wrote:
>> On Fri, 8 Sep 2006, Heikki Linnakangas wrote:
>>
>>> Looks like Alvaro guessed right. It reads both relations in sequence,
>>> sorts them in temporary storage, outside bufmgr, and then does a merge
>>> join on the sorted inputs.
>>
>> could you tell me how can we trace that? I mean which functions shall I
>> checkout for that.
>
> The sort code is in src/backend/utils/sort/tuplesort.c and logtape.c. Can't
> remember function names from the top of my head.
>
>

--
N Praveen Kumar
Btech-IV CSE
IIIT,Hyd
AP,India

Imagination is more important than knowledge...
--Albert Einstein

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manuel Sugawara 2006-09-08 16:53:10 Query returning tuples that does not satisfy the WHERE clause
Previous Message Martijn van Oosterhout 2006-09-08 16:30:39 Re: Fixed length data types issue