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 [EMAIL PROTECTED] Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings