pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Sidar L?pez Cruz <sidarlopez@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: performance on query
Date: Wed, 26 Oct 2005 22:00:13 -0500
Message-ID: <20051027030013.GE16682@pervasive.com> (raw)
In-Reply-To: <BAY23-F36614886359D96AC48B8BCE690@phx.gbl>
References: <BAY23-F36614886359D96AC48B8BCE690@phx.gbl>

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@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (2+ messages)

Message-ID: <20051027030013.GE16682@pervasive.com>
Permalink:  ../20051027030013.GE16682@pervasive.com/
Also on:    postgresql.org/message-id/20051027030013.GE16682@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, sidarlopez@hotmail.com
  Subject: Re: performance on query
  In-Reply-To: <20051027030013.GE16682@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox