pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedavoid select expens_expr(col) like unneccessary calculations
4+ messages / 4 participants
[nested] [flat]
* avoid select expens_expr(col) like unneccessary calculations
@ 2003-07-07 22:35 Markus Bertheau <twanger@bluetwanger.de>
0 siblings, 2 replies; 4+ messages in thread
From: Markus Bertheau @ 2003-07-07 22:35 UTC (permalink / raw)
To: pgsql-sql
Hi,
when you have
select expensive_expression(column), * from table offset 20 limit 40
can you somehow save the cost for the first 20 calculations of
expensive_expression?
--
Markus Bertheau.
Berlin, Berlin.
Germany.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: avoid select expens_expr(col) like unneccessary calculations
@ 2003-07-07 22:47 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: Markus Bertheau <twanger@bluetwanger.de>
1 sibling, 1 reply; 4+ messages in thread
From: Stephan Szabo @ 2003-07-07 22:47 UTC (permalink / raw)
To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql
On 8 Jul 2003, Markus Bertheau wrote:
> when you have
> select expensive_expression(column), * from table offset 20 limit 40
>
> can you somehow save the cost for the first 20 calculations of
> expensive_expression?
Right now the only way I can think of that might work is to push the
offset/limit into a subselect on table and then do the
expensive_expression at the top level.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: avoid select expens_expr(col) like unneccessary calculations
@ 2003-07-07 22:55 scott.marlowe <scott.marlowe@ihs.com>
parent: Markus Bertheau <twanger@bluetwanger.de>
1 sibling, 0 replies; 4+ messages in thread
From: scott.marlowe @ 2003-07-07 22:55 UTC (permalink / raw)
To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql
On 8 Jul 2003, Markus Bertheau wrote:
> Hi,
>
> when you have
> select expensive_expression(column), * from table offset 20 limit 40
>
> can you somehow save the cost for the first 20 calculations of
> expensive_expression?
Might a functional or partial index work here?
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: avoid select expens_expr(col) like unneccessary calculations
@ 2003-07-21 15:23 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2003-07-21 15:23 UTC (permalink / raw)
To: Stephan Szabo <sszabo@megazone.bigpanda.com>; +Cc: Markus Bertheau <twanger@bluetwanger.de>; pgsql-sql
Stephan Szabo wrote:
> On 8 Jul 2003, Markus Bertheau wrote:
>
> > when you have
> > select expensive_expression(column), * from table offset 20 limit 40
> >
> > can you somehow save the cost for the first 20 calculations of
> > expensive_expression?
>
> Right now the only way I can think of that might work is to push the
> offset/limit into a subselect on table and then do the
> expensive_expression at the top level.
Well, you can do:
SELECT * FROM (SELECT * FROM pg_class) AS pg_class
so you could do:
SELECT func(relname), *
FROM (SELECT * FROM pg_class OFFSET 20 LIMIT 40) AS pg_class
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-07-21 15:23 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-07 22:35 avoid select expens_expr(col) like unneccessary calculations Markus Bertheau <twanger@bluetwanger.de>
2003-07-07 22:47 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2003-07-21 15:23 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-07-07 22:55 ` scott.marlowe <scott.marlowe@ihs.com>
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