Re: performance on query

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Sidar L?pez Cruz <sidarlopez(at)hotmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: performance on query
Date: 2005-10-27 03:00:13
Message-ID: 20051027030013.GE16682@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

So the issue is that instead of taking 174 seconds the query now takes
201?

I'm guessing that SQL server might be using index covering, but that's
just a guess. Posting query plans (prefferably with actual timing info;
EXPLAIN ANALYZE on PostgreSQL and whatever the equivalent would be for
MSSQL) might give us some idea.

On Wed, Oct 26, 2005 at 05:47:31PM -0600, Sidar L?pez Cruz wrote:
> I DON'T KNOW WHAT TO DO WITH THIS QUERYS...
> Comparation with sql server, sql server wins !!!
>
>
> Table sizes:
> archivos: 40MB
> fotos: 55MB
>
> select count(1) from fotos f where not exists (select a.archivo from
> archivos a where a.archivo=f.archivo)
> 173713 ms.
> 110217 ms.
> 83122 ms.
>
> select count(*) from
> (
> select archivo from fotos
> except
> select archivo from archivos
> ) x;
> 201479 ms.
>
> SELECT count(*)
> FROM fotos f
> LEFT JOIN archivos a USING(archivo)
> WHERE a.archivo IS NULL
> 199523 ms.
>
> _________________________________________________________________
> MSN Amor: busca tu ? naranja http://latam.msn.com/amor/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2005-10-27 09:33:40 Re: Perfomance of views
Previous Message Christopher Kings-Lynne 2005-10-27 01:46:14 Re: browsing table with 2 million records