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

Patrick's Evil Query

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: sfpug(at)postgresql(dot)org
Subject: Patrick's Evil Query
Date: 2003-01-14 21:09:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: sfpug

For those of you who were present at last night's meeting, we decided to 
tackle an "evil" query presented us by Patrick, which was taking 3.5 minutes 
to execute.

For David & Matt, who had to leave before we solved it, Stephan and I found 
the problem.   At the output stage of the query, Patrick was executing a 
60-line CASE statement with type conversions which accounted for a full 
minute-and-a-half of the excution time for the query.   Replaceing the CASE 
statement with a function should improve the situation.

-Josh Berkus
 Aglio Database Solutions
 San Francisco

sfpug by date

Next:From: eleinDate: 2003-01-14 23:54:30
Subject: Re: Bring Query Problems to Meeting!
Previous:From: Josh BerkusDate: 2003-01-14 17:16:24
Subject: Bring Query Problems to Meeting!

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