pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Gamache <cgg007@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: A Costly function + LIMIT
Date: Fri, 13 Dec 2002 10:14:35 -0800 (PST)
Message-ID: <20021213181435.31771.qmail@web13804.mail.yahoo.com> (raw)

PostgreSQL 7.2.3

I have a function that is quite costly to run on 1000's of records... Let's
call it "widget". 

I have a query

(SELECT name, address, city, state, zip, widget(name, address, city, state,
zip) 
FROM eastern_usa 
ORDER BY state, city, zip, name 
LIMIT 5000)

UNION ALL

(SELECT name, address, city, state, zip, widget(name, address, city, state,
zip) 
FROM western_usa 
ORDER BY state, city, zip, name 
LIMIT 5000)

ORDER BY 4, 3, 5, 1 LIMIT 100 OFFSET 0;

It runs "widget" on 10000 records. The damage would be negligible if it could
run on the 100... 

Any ideas?

CG

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



view thread (2+ messages)  latest in thread

Message-ID: <20021213181435.31771.qmail@web13804.mail.yahoo.com>
Permalink:  ../20021213181435.31771.qmail@web13804.mail.yahoo.com/
Also on:    postgresql.org/message-id/20021213181435.31771.qmail@web13804.mail.yahoo.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-sql@postgresql.org
  Cc: cgg007@yahoo.com
  Subject: Re: A Costly function + LIMIT
  In-Reply-To: <20021213181435.31771.qmail@web13804.mail.yahoo.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