Re: [HACKERS] costing for arbitrary path

2007-01-03 Thread Tom Lane
uwcssa <[EMAIL PROTECTED]> writes:
> The problem is that each join method has some value that seems to
> change value each time I cost the SAME path.

There's a bug in your code; but you've not provided nearly enough detail
to identify exactly what it is.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[HACKERS] costing for arbitrary path

2007-01-03 Thread uwcssa

I wish to estimate the total cost for a given path of a query. This
path is a tree consists of nestloop, hashjoin, mergejoin as internal
nodes with seqscan or idxscan at the leaves.

My approach is to cost the path bottom-up, and invoke the
"cost_nestloop", "cost_merge_join" etc.

The problem is that each join method has some value that seems to
change value each time I cost the SAME path.  For example, the
hash-join has "thisbucketsize" varying from time to time. I noticed
this is because the caching the bucket size estimate inside the
RestrictInfo structure. Is there a easy way to cost a give path?

---(end of broadcast)---
TIP 6: explain analyze is your friend