pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Update
3+ messages / 2 participants
[nested] [flat]

* Update
@ 2001-04-07 18:37 Kyle <kyle@actarg.com>
  2001-04-13 03:03 ` Re: Update Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Kyle @ 2001-04-07 18:37 UTC (permalink / raw)
  To: tgl@sss.pgh.pa.us; +Cc: pgsql-sql

OK, I figured it out.  It wasn't the sum(int4) thing...

I have a query that looks like this:

select pnum from part where func1(pnum) and func2(pnum);

Func1 takes less time to execute than func2.  I was using func1 to
"narrow the field" of records so the query would not take so long to
execute.  After upgrading to 7.1 the query got real slow.  After
changing the query to:

select pnum from part where func2(pnum) and func1(pnum);

The query went back to its normal time.

It appears that the first function would get evaluated first under 7.0.3
but the last function gets evaluated first under 7.1.  Is that accurate?

Is there a way to control which functions are given precidence?

Kyle

Attachments:

kyle.vcf (text/x-vcard, 184B) download begin:vcard n:Bateman;Kyle x-mozilla-html:FALSE org:Action Target Inc. adr:;;;;;; version:2.1 email;internet:kyle@actarg.com title:President x-mozilla-cpt:;0 fn:Kyle Bateman end:vcard
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: Update
  2001-04-07 18:37 Update Kyle <kyle@actarg.com>
@ 2001-04-13 03:03 ` Tom Lane <tgl@sss.pgh.pa.us>
  2001-04-13 14:58   ` Re: Update Kyle <kyle@actarg.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2001-04-13 03:03 UTC (permalink / raw)
  To: Kyle <kyle@Actarg.com>; +Cc: pgsql-sql

Kyle <kyle@Actarg.com> writes:
> It appears that the first function would get evaluated first under 7.0.3
> but the last function gets evaluated first under 7.1.  Is that accurate?

Actually, I was under the impression that (all else being equal) WHERE
clauses would get evaluated right-to-left in 7.0.* as well.  I was
meaning to figure out where the clause order reversal is happening and
undo it, but didn't get around to it for 7.1.

> Is there a way to control which functions are given precidence?

Nope, not at the moment.  The code has remnants of a notion of cost of
evaluation for functions, but it's not being used for anything ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Update
  2001-04-07 18:37 Update Kyle <kyle@actarg.com>
  2001-04-13 03:03 ` Re: Update Tom Lane <tgl@sss.pgh.pa.us>
@ 2001-04-13 14:58   ` Kyle <kyle@actarg.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Kyle @ 2001-04-13 14:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

Tom Lane wrote:

> Kyle <kyle@Actarg.com> writes:
> > It appears that the first function would get evaluated first under 7.0.3
> > but the last function gets evaluated first under 7.1.  Is that accurate?
>
> Actually, I was under the impression that (all else being equal) WHERE
> clauses would get evaluated right-to-left in 7.0.* as well.  I was
> meaning to figure out where the clause order reversal is happening and
> undo it, but didn't get around to it for 7.1.
>
> > Is there a way to control which functions are given precidence?
>
> Nope, not at the moment.  The code has remnants of a notion of cost of
> evaluation for functions, but it's not being used for anything ...
>

Might be interesting to have something like:

create function ... as ... with cost=x;

It would also be cool to supply a default set of parameters to the function.
Then "vaccum analyze" or some such thing could execute the functions, time
them, and store cost data internally...

create function ... as ... with default(3,7,4);
or
create function myfunc (int4 3, float8 7, numeric 4) ...;

BTW, great job on 7.1!  Kudos to all the developers who are working so hard
to make it happen.

Attachments:

kyle.vcf (text/x-vcard, 184B) download begin:vcard n:Bateman;Kyle x-mozilla-html:FALSE org:Action Target Inc. adr:;;;;;; version:2.1 email;internet:kyle@actarg.com title:President x-mozilla-cpt:;0 fn:Kyle Bateman end:vcard
^ permalink raw reply [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-04-13 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-07 18:37 Update Kyle <kyle@actarg.com>
2001-04-13 03:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-04-13 14:58   ` Kyle <kyle@actarg.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