Re: [PERFORM] Query Performance

2004-08-20 Thread Brad Bulger
Have you tried AND (sn.notafiscalnumero, sn.notafiscalserie, sn.cliente) NOT IN ( SELECT numero, serie, codigo FROM r_contrato WHERE savfonte = 'lg') or and not exists(select true from r_contrato where savfonte = 'lg' and numero = sn.notafiscalnumero and serie = sn.notafiscalserie and codigo = s

[PERFORM] Query Performance

2004-08-20 Thread Danilo Mota
Hi all,    the following query is working well without the AND on WHERE clause, so I need suggestions about how could I rewrite the query to get the same result with less cost of time and resources.   I’ve already created indexes on all foreign key columns.   Thanks in advance.   Da

Re: [PERFORM] using an index worst performances

2004-08-20 Thread Tom Lane
Gaetano Mendola <[EMAIL PROTECTED]> writes: > Tom Lane wrote: > | Could we see EXPLAIN ANALYZE EXECUTE output for each case? > [snip] > See above. Okay, so the issue here is choosing between a nestloop or a hash join that have very nearly equal estimated costs: > ~ -> Hash Join (

Re: [PERFORM] using an index worst performances

2004-08-20 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: | Gaetano Mendola <[EMAIL PROTECTED]> writes: | |>Using a prepared query: | | |>Without index and default stat 10 :1.12 ms ariadne=# explain analyze execute test_ariadne; ~

Re: [PERFORM] Query performance problem

2004-08-20 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > I am going to assume that one of the sc.cpfcnpj's above is really rc.cpfcnpj > since that corresponds to the explain below. No, actually the explain plan corresponds to the sc.cpfcnpj = sc.cpfcnpj condition. I didn't twig to the typo until I started t

Re: [PERFORM] Query performance problem

2004-08-20 Thread Bruno Wolff III
On Fri, Aug 20, 2004 at 13:25:30 -0300, Danilo Mota <[EMAIL PROTECTED]> wrote: > > And the following tables: > TABLES > > -- > == r_cliente: 75816 records >

Re: [PERFORM] Query performance problem

2004-08-20 Thread Tom Lane
"Danilo Mota" <[EMAIL PROTECTED]> writes: > SELECT > rc.pkcliente > FROM r_cliente AS rc > INNER JOIN sav_cliente_lg AS sc ON sc.cpfcnpj = sc.cpfcnpj; Surely you meant INNER JOIN sav_cliente_lg AS sc ON rc.cpfcnpj = sc.cpfcnpj; I would also venture that your statistics are desperately out of d

[PERFORM] Query performance problem

2004-08-20 Thread Danilo Mota
HI All,   I have a big performance issue concerning a PostgreSQL database.   I have the following server configuration:   Pentium 4 2.4 GHz 1 GB RAM 36 GB SCSI   And the following tables:     TABLES

Re: [PERFORM] using an index worst performances

2004-08-20 Thread Tom Lane
Gaetano Mendola <[EMAIL PROTECTED]> writes: > Using a prepared query: > Without index and default stat 10 :1.12 ms > Without index and default stat 1000 : 1.25 ms > With index and default stat 10:1.35 ms > With index and default stat 1000: 1.6 ms Could we see EXPLAIN ANALYZE EXE

Re: [PERFORM] using an index worst performances

2004-08-20 Thread Gaetano Mendola
Rod Taylor wrote: On Fri, 2004-08-20 at 05:37, Gaetano Mendola wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Christopher Kings-Lynne wrote: |>>> Without index: 1.140 ms |>>> With index: 1.400 ms |>>> With default_statistic_targer = 200: 1.800 ms |>> |>> |>> |>> |>> Can I just check that 1.

Re: [PERFORM] I could not get postgres to utilizy indexes

2004-08-20 Thread Leeuw van der, Tim
Hi all, I offered apologies to Igor Artimenko in private mail already; I'll apologize again here. About top-posting: Outlook Exchange teaches bad habits. Can you set Outlook Exchange to prefix lines with "> " only when mail is in text-only format but not when mail arrives in html / rtf format?

Re: [PERFORM] I could not get postgres to utilizy indexes

2004-08-20 Thread Manfred Koizar
On Thu, 19 Aug 2004 09:54:47 +0200, "Leeuw van der, Tim" <[EMAIL PROTECTED]> wrote: >You asked the very same question yesterday, and I believe you got some useful >answers. Why do you post the question again? Tim, no need to be rude here. We see this effect from time to time when a new user send

[PERFORM] pg_restore very slow in 8.0.0beta1

2004-08-20 Thread Bonnin S.
Hi, I'm migrating data from 7.4.2 to 8.0.0beta1 and the process is slow (10 15 tuples per second)   Can be a type conversion issue?   RedS

Re: [PERFORM] using an index worst performances

2004-08-20 Thread Rod Taylor
On Fri, 2004-08-20 at 05:37, Gaetano Mendola wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Christopher Kings-Lynne wrote: > > |>>> Without index: 1.140 ms > |>>> With index: 1.400 ms > |>>> With default_statistic_targer = 200: 1.800 ms > |>> > |>> > |>> > |>> > |>> Can I just che

Re: [PERFORM] using an index worst performances

2004-08-20 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Christopher Kings-Lynne wrote: |>>> Without index: 1.140 ms |>>> With index: 1.400 ms |>>> With default_statistic_targer = 200: 1.800 ms |>> |>> |>> |>> |>> Can I just check that 1.800ms means 1.8 secs (You're using . as the |>> thousands separator)?