Re: [GENERAL] UDF in C slow

2012-05-11 Thread Inanc Seylan
I'm quite new to Postgres so I don't know how to read the execution plans. However it is obvious that the plans for the query with and without the function are different. I added some indices to the table roleassertions and it seems to solve this big difference in the execution times of both qu

Re: [GENERAL] UDF in C slow

2012-05-11 Thread Tom Lane
Inanc Seylan writes: > It is IMMUTABLE. I attach the output of EXPLAIN both with and without > the simple function (returning true only) in the query. EXPLAIN ANALYZE would have been far more helpful. However, the thing that jumps out at me here is all the seqscans on table "symbols". Do you no

Re: [GENERAL] UDF in C slow

2012-05-11 Thread Inanc Seylan
It is IMMUTABLE. I attach the output of EXPLAIN both with and without the simple function (returning true only) in the query. On 5/11/12 4:21 PM, Alban Hertroys wrote: On 11 May 2012 15:57, Inanc Seylan wrote: Hi all, I have implemented a user-defined function in C that returns a boolean val

Re: [GENERAL] UDF in C slow

2012-05-11 Thread Alban Hertroys
On 11 May 2012 15:57, Inanc Seylan wrote: > Hi all, > > I have implemented a user-defined function in C that returns a boolean value > after some computation. Now I have a query Q such that when I specify the > function in the WHERE clause of Q, Q runs in 40 secs and if I don't use the > function