Re: Keeping temporary tables in shared buffers

2018-06-23 Thread Bruce Momjian
On Thu, Jun 21, 2018 at 07:42:54AM +0530, Amit Kapila wrote: > On Wed, Jun 20, 2018 at 8:47 PM, Bruce Momjian wrote: > > On Sat, Jun 2, 2018 at 05:18:17PM -0400, Asim Praveen wrote: > >> Hi Amit > >> > >> On Mon, May 28, 2018 at 4:25 AM, Amit Kapila > >> wrote: > >> > > >> > This is one way, bu

Re: Keeping temporary tables in shared buffers

2018-06-23 Thread Amit Kapila
On Fri, Jun 22, 2018 at 6:09 PM, Robert Haas wrote: > On Mon, May 28, 2018 at 4:25 AM, Amit Kapila wrote: >> On Fri, May 25, 2018 at 6:33 AM, Asim Praveen wrote: >>> We are evaluating the use of shared buffers for temporary tables. The >>> advantage being queries involving temporary tables can

Re: Keeping temporary tables in shared buffers

2018-06-22 Thread Robert Haas
On Mon, May 28, 2018 at 4:25 AM, Amit Kapila wrote: > On Fri, May 25, 2018 at 6:33 AM, Asim Praveen wrote: >> We are evaluating the use of shared buffers for temporary tables. The >> advantage being queries involving temporary tables can make use of parallel >> workers. > This is one way, but I

Re: Keeping temporary tables in shared buffers

2018-06-20 Thread Amit Kapila
On Wed, Jun 20, 2018 at 8:47 PM, Bruce Momjian wrote: > On Sat, Jun 2, 2018 at 05:18:17PM -0400, Asim Praveen wrote: >> Hi Amit >> >> On Mon, May 28, 2018 at 4:25 AM, Amit Kapila wrote: >> > >> > This is one way, but I think there are other choices as well. We can >> > identify and flush all th

Re: Keeping temporary tables in shared buffers

2018-06-20 Thread Bruce Momjian
On Sat, Jun 2, 2018 at 05:18:17PM -0400, Asim Praveen wrote: > Hi Amit > > On Mon, May 28, 2018 at 4:25 AM, Amit Kapila wrote: > > > > This is one way, but I think there are other choices as well. We can > > identify and flush all the dirty (local) buffers for the relation > > being accessed pa

Re: Keeping temporary tables in shared buffers

2018-06-02 Thread Asim Praveen
Hi Amit On Mon, May 28, 2018 at 4:25 AM, Amit Kapila wrote: > > This is one way, but I think there are other choices as well. We can > identify and flush all the dirty (local) buffers for the relation > being accessed parallelly. Now, once the parallel operation is > started, we won't allow per

Re: Keeping temporary tables in shared buffers

2018-05-28 Thread Amit Kapila
On Fri, May 25, 2018 at 6:33 AM, Asim Praveen wrote: > Hello > > We are evaluating the use of shared buffers for temporary tables. The > advantage being queries involving temporary tables can make use of parallel > workers. > This is one way, but I think there are other choices as well. We can

Re: Keeping temporary tables in shared buffers

2018-05-25 Thread Ashwin Agrawal
On Thu, May 24, 2018 at 11:50 PM, Andres Freund wrote: > On 2018-05-25 09:40:10 +0300, Heikki Linnakangas wrote: > > On 25/05/18 09:25, Asim Praveen wrote: > > > My parochial vision of the overhead is restricted to 4 * NBuffers of > > > additional shared memory, as 4 bytes are being added to Buff

Re: Keeping temporary tables in shared buffers

2018-05-24 Thread Andres Freund
On 2018-05-25 09:40:10 +0300, Heikki Linnakangas wrote: > On 25/05/18 09:25, Asim Praveen wrote: > > My parochial vision of the overhead is restricted to 4 * NBuffers of > > additional shared memory, as 4 bytes are being added to BufferTag. May I > > please get some enlightenment? > > Any extra f

Re: Keeping temporary tables in shared buffers

2018-05-24 Thread Heikki Linnakangas
On 25/05/18 09:25, Asim Praveen wrote: On Thu, May 24, 2018 at 8:19 PM, Tom Lane wrote: So then you have to think about how to transition smoothly between "rel is in local buffers" and "rel is in shared buffers", bearing in mind that ever having the same page in two different buffers would be

Re: Keeping temporary tables in shared buffers

2018-05-24 Thread Asim Praveen
On Thu, May 24, 2018 at 8:19 PM, Tom Lane wrote: > > So then you have to think about how to transition smoothly between "rel > is in local buffers" and "rel is in shared buffers", bearing in mind that > ever having the same page in two different buffers would be disastrous. Local buffers would no

Re: Keeping temporary tables in shared buffers

2018-05-24 Thread Tom Lane
Asim Praveen writes: > We are evaluating the use of shared buffers for temporary tables. The > advantage being queries involving temporary tables can make use of parallel > workers. Hm... > Challenges: > 1. We lose the performance benefit of local buffers. Yeah. This would be an absolute dea