Re: Disk usage for intermediate results in join algorithms

From: Jay Riddle <jcriddle4(at)yahoo(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Disk usage for intermediate results in join algorithms
Date: 2014-03-11 13:17:32
Message-ID: 1394543852.25742.YahooMailNeo@web126102.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I think the amount of data being processed would also play a role in if the disk is used for intermediate results or not. As an example if you query a huge table lets say of test_results and you ask the database to sort the data on a non-indexed column say creation_date.  If it the database sees a creation_date of 1/1/2001 the database cannot return that row to the user yet because as the database looks through the table it may find a earlier date or 1/1/1999. This forces the database to look through and process all the rows before returning any data to the user. If you place a index on the creation_date column then the database may have a way of pulling the data without sorting the data in memory(or disk) as the index will let the database know which rows come first. There may be some other query operations where the database needs to store large intermediate results that could also spill out to disk. 

--JayR

________________________________
From: Parul Lakkad <parul(dot)lakkad(at)gmail(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Sent: Tuesday, March 11, 2014 4:24 AM
Subject: [NOVICE] Disk usage for intermediate results in join algorithms

Hi,

I am trying to figure out when disk is used to store intermediate results while performing joins in postgres.

According my findings using 'explain analyse ' only merge sort uses disk.
Can anyone please throw some more light on this?

Thanks,
Parul

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ken Benson 2014-03-11 14:17:39 Re: Best method for storing recoverable passwords
Previous Message Parul Lakkad 2014-03-11 11:24:01 Disk usage for intermediate results in join algorithms