Re: Performance on Bulk Insert to Partitioned Table - Mailing list pgsql-performance

From Vitalii Tymchyshyn
Subject Re: Performance on Bulk Insert to Partitioned Table
Date
Msg-id CABWW-d25EyTzez=AbxB=kn+1w8aZOuh51-GLqWLBGNmRAizEtw@mail.gmail.com
Whole thread Raw
In response to Re: Performance on Bulk Insert to Partitioned Table  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Performance on Bulk Insert to Partitioned Table  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-performance
Why so? Basic form "case lvalue when rvalue then out ... end" is much like switch. 
The "case when condition then out ... end" is different, more complex beast, but first one is essentially a switch. If it is now trnasformed into 
"case when lvalue = rvalue1 then out1 when lvalue=rvalue2 then out2 ... end" then this can be optimized and this would benefit many users, not only ones that use partitioning.


2012/12/28 Stephen Frost <sfrost@snowman.net>
Vitalii,

* Vitalii Tymchyshyn (tivv00@gmail.com) wrote:
> There is switch-like sql case:
[...]
> It should work like C switch statement.

It does and it doesn't.  It behaves generally like a C switch statement,
but is much more flexible and therefore can't be optimized like a C
switch statement can be.

        Thanks,

                Stephen



--
Best regards,
 Vitalii Tymchyshyn

pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Performance on Bulk Insert to Partitioned Table
Next
From: Vitalii Tymchyshyn
Date:
Subject: Re: Performance on Bulk Insert to Partitioned Table