Re: [GENERAL] Diferences between IN and EXISTS?

2013-02-02 Thread Edson Richter
Ok, I get it. Good education! Thank you very much, saved me a big headache! Edson Em 03/02/2013 03:06, Pavel Stehule escreveu: Hello 2013/2/3 Edson Richter : Hi! Assumptions: PostgreSQL 9.2.2, Win64, already run vacumm full freeze analyze. No problems in the database. I know there are 1247

Re: [GENERAL] Diferences between IN and EXISTS?

2013-02-02 Thread Pavel Stehule
Hello 2013/2/3 Edson Richter : > Hi! > > Assumptions: PostgreSQL 9.2.2, Win64, already run vacumm full freeze > analyze. No problems in the database. I know there are 1247 records to be > found. > Why does these queries return different results: > > > select count(*) from parcela > where id not in

[GENERAL] Diferences between IN and EXISTS?

2013-02-02 Thread Edson Richter
Hi! Assumptions: PostgreSQL 9.2.2, Win64, already run vacumm full freeze analyze. No problems in the database. I know there are 1247 records to be found. Why does these queries return different results: select count(*) from parcela where id not in (select parcela_id from cadastroservicoparce

Re: [GENERAL] What language is faster, C or PL/PgSQL?

2013-02-02 Thread Carlo Stonebanks
Here is an advantage Plpgsql has: http://www.postgresql.org/docs/9.1/static/plpgsql-expressions.html I guess you can offset this by creating your own prepared statements in C. Otherwise, I can’t think of how C could be slower. I would choose C for functions that don’t have SQL statements in the

Re: [GENERAL] What language is faster, C or PL/PgSQL?

2013-02-02 Thread Ovnicraft
On Sat, Feb 2, 2013 at 10:42 AM, Karel Riverón Escobar < kesco...@estudiantes.uci.cu> wrote: > Hi people, > > I need to write an algorithm for processing large amounts of data. I want > to write a function on PgAdmin 3 to solve my problem. I need to know what > language should be used, C or PL/Pg

[GENERAL] What language is faster, C or PL/PgSQL?

2013-02-02 Thread Karel Riverón Escobar
Hi people, I need to write an algorithm for processing large amounts of data. I want to write a function on PgAdmin 3 to solve my problem. I need to know what language should be used, C or PL/PgSQL? Needless to say, what I need is quickly. What language is faster, C or PL/PgSQL? Greetings,

Re: [GENERAL] Optimizing query?

2013-02-02 Thread Pavel Stehule
2013/2/2 Pavel Stehule : > 2013/2/2 : >> Pavel Stehule wrote: >> but maybe https://github.com/dimitri/prefix can help >> >> Hi Pavel, >> >> thanks - this works perfect. However, it does not seem to play well >> with the optimizer, so I ended up with >> >> select all candidates into

Re: [GENERAL] Optimizing query?

2013-02-02 Thread Pavel Stehule
2013/2/2 : > Pavel Stehule wrote: > >>> >>> but maybe https://github.com/dimitri/prefix can help >>> > > Hi Pavel, > > thanks - this works perfect. However, it does not seem to play well > with the optimizer, so I ended up with > > select all candidates into a temp table using prefix operator > a

Re: [GENERAL] Optimizing query?

2013-02-02 Thread hamann . w
Pavel Stehule wrote: >> >> but maybe https://github.com/dimitri/prefix can help >> Hi Pavel, thanks - this works perfect. However, it does not seem to play well with the optimizer, so I ended up with select all candidates into a temp table using prefix operator apply all other conditions by