Skip site navigation (1) Skip section navigation (2)

AW: Strange query execution time

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Michel Soto'" <Michel(dot)Soto(at)lip6(dot)fr>, pgsql-hackers(at)postgresql(dot)org
Subject: AW: Strange query execution time
Date: 2001-07-05 07:55:04
Message-ID: 11C1E6749A55D411A9670001FA687963368361@sdexcsrv1.f000.d0188.sd.spardat.at (view raw or flat)
Thread:
Lists: pgsql-hackers
> Can  someone explain why the following query takes  1 second when using 
> LIKE and takes 30 seconds when replacing LIKE by = in the WHERE ? 

Because there is no optimization built in, that notices, that your
string does not contain a wildcard and would translate the restriction 
correspondingly. It is currently executed more or less like below:
	(I3.nameInfluence >= 'inf_vitesse' and I3.nameInfluence < 'inf_vitessf'
 	 and I3.nameInfluence LIKE  'inf_vitesse')
I already wanted to try to add this optimization myself, but lacked the time so far.
Anybody want to volunteer ?

TODO: add LIKE optimization to use = if constant does not contain any wildcards

Andreas

Responses

pgsql-hackers by date

Next:From: Zeugswetter Andreas SBDate: 2001-07-05 09:42:37
Subject: AW: Re: Backup and Recovery
Previous:From: Alessio BragadiniDate: 2001-07-05 07:32:47
Subject: Re: [OT] Any major users of postgresql?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group