Re: [GENERAL] create table in memory

2012-11-28 Thread Seref Arikan
Thanks Merlin, I'll take a better look at CTE. Best regards Seref On Tue, Nov 27, 2012 at 4:48 PM, Merlin Moncure wrote: > On Tue, Nov 27, 2012 at 10:06 AM, Seref Arikan > wrote: > > I have a function that creates a temp table, inserts rows into it, > performs > > joins, and returns a single

Re: [GENERAL] create table in memory

2012-11-27 Thread Merlin Moncure
On Tue, Nov 27, 2012 at 10:06 AM, Seref Arikan wrote: > I have a function that creates a temp table, inserts rows into it, performs > joins, and returns a single integer as a result. This is pg 9.1. All > sessions are using the exact same temp table structure. > re performance requirements: I need

Re: [GENERAL] create table in memory

2012-11-27 Thread Seref Arikan
I have a function that creates a temp table, inserts rows into it, performs joins, and returns a single integer as a result. This is pg 9.1. All sessions are using the exact same temp table structure. re performance requirements: I need this function to return as fast as possible :) On a production

Re: [GENERAL] create table in memory

2012-11-27 Thread Merlin Moncure
On Tue, Nov 27, 2012 at 9:44 AM, Seref Arikan wrote: >> > Also I need those tables per session, so creating and dropping with TEMP >> > tables appear to be faster. >> >> Performance of creating tables is going to be storage bound. what are >> your performance requirements? Even if the temp table

Re: [GENERAL] create table in memory

2012-11-27 Thread Seref Arikan
Hi Merlin, See below please On Tue, Nov 27, 2012 at 3:29 PM, Merlin Moncure wrote: > On Fri, Nov 23, 2012 at 4:09 AM, Peter Kroon wrote: > > I've put up a small test case for creating TEMP and UNLOGGED tables. > > DROP TABLE IF EXISTS test CASCADE; > > CREATE TEMP TABLE test( > > id serial, > >

Re: [GENERAL] create table in memory

2012-11-27 Thread Merlin Moncure
On Fri, Nov 23, 2012 at 4:09 AM, Peter Kroon wrote: > I've put up a small test case for creating TEMP and UNLOGGED tables. > DROP TABLE IF EXISTS test CASCADE; > CREATE TEMP TABLE test( > id serial, > the_value text > ); > Exec time: 54ms > > DROP TABLE IF EXISTS test CASCADE; > CREATE UNLOGGED TA

Re: [GENERAL] create table in memory

2012-11-26 Thread Peter Kroon
Could you provide an example? Fo me: Drop/Creat/populating tables inside a function are slow. Creating tables outside a function and populating he table inside a function is fast.. 2012/11/24 Craig Ringer > On 11/24/2012 02:15 AM, Peter Kroon wrote: > > I found out that declaring tables outsid

Re: [GENERAL] create table in memory

2012-11-23 Thread Craig Ringer
On 11/24/2012 02:15 AM, Peter Kroon wrote: > I found out that declaring tables outside of functions increases the > execution time of the function. Strictly, what's probably happening is that creating a table in the same transaction as populating it is a lot faster than creating it, committing, and

Re: [GENERAL] create table in memory

2012-11-23 Thread Peter Kroon
I found out that declaring tables outside of functions increases the execution time of the function. And CREATE UNLOGGED TABLE is very fast. 2012/11/23 Peter Kroon > I've put up a small test case for creating TEMP and UNLOGGED tables. > DROP TABLE IF EXISTS test CASCADE; > CREATE TEMP TABLE tes

Re: [GENERAL] create table in memory

2012-11-23 Thread Peter Kroon
I've put up a small test case for creating TEMP and UNLOGGED tables. DROP TABLE IF EXISTS test CASCADE; CREATE TEMP TABLE test( id serial, the_value text ); Exec time: 54ms DROP TABLE IF EXISTS test CASCADE; CREATE UNLOGGED TABLE test( id serial, the_value text ); Exec time: 198ms There is a sign

Re: [GENERAL] create table in memory

2012-11-23 Thread Raghavendra
On Fri, Nov 23, 2012 at 2:43 PM, Peter Kroon wrote: > I've converted some mssql functions and they appear to be slower in pgsql. > I use a lot of declared tables in mssql as they are created in memory. > Which makes it very fast. > > 2012/11/23 Peter Kroon > >> Is a temp table created to memory(

Re: [GENERAL] create table in memory

2012-11-23 Thread raghu ram
On Fri, Nov 23, 2012 at 2:43 PM, Peter Kroon wrote: > I've converted some mssql functions and they appear to be slower in pgsql. > I use a lot of declared tables in mssql as they are created in memory. > Which makes it very fast. > > > > 2012/11/23 Peter Kroon > >> Is a temp table created to mem

Re: [GENERAL] create table in memory

2012-11-23 Thread Peter Kroon
I've converted some mssql functions and they appear to be slower in pgsql. I use a lot of declared tables in mssql as they are created in memory. Which makes it very fast. 2012/11/23 Peter Kroon > Is a temp table created to memory(ram) or disk? > I've converted some msssq >

[GENERAL] create table in memory

2012-11-23 Thread Peter Kroon
Is a temp table created to memory(ram) or disk? I've converted some msssq