Using the GEQO

Started by Ms swati chandeover 16 years ago3 messagesgeneral
Jump to latest
#1Ms swati chande
swativc@yahoo.com

Hi,
 
I have a few queries on the use of the geqo.
 
1. Since the value of geqo_threshold is12, does the geqo get automatically activated for queries with 12 or more joins?
2. Can the geqo threshold be set to a smaller value like 4 or 5?
3. How do we come to know whether the geqo has been used to solve the query or not? Does Explain Analyze report it?
4. If we change the value of geqo_threshold do we have to change any other parameters necessarily?
 
Please let me know these basics on the use of the geqo.
 
Thanks
Regards
Swati

#2Andres Freund
andres@anarazel.de
In reply to: Ms swati chande (#1)
Re: Using the GEQO

On Thursday 16 July 2009 09:02:53 Ms swati chande wrote:

1. Since the value of geqo_threshold is12, does the geqo get automatically
activated for queries with 12 or more joins?

No, not directly. It will get used for 12 joins with no predefined order.

This is a bit complicated by the fact that even a predefined order like:
a JOIN b ON (..) JOIN c ON (..) ...
might get reordered if the number of joins is less than join_collapse_limit.

See
http://www.postgresql.org/docs/current/static/explicit-joins.html

2. Can the geqo threshold be set to a smaller value like 4 or 5?

Yes

3. How do we come to know whether the geqo has been used to solve the query
or not? Does Explain Analyze report it?

No, you cannot see it directly unless you recompile with different options.

4. If we change the value of geqo_threshold do we have to change any other

parameters necessarily?
No.

Please let me know these basics on the use of the geqo.

Why do you want to specifically use GEQO? Just Research? Normally you try not
to get where GEQO is used ;-)

Andres

#3Ms swati chande
swativc@yahoo.com
In reply to: Andres Freund (#2)
Re: Using the geqo

Thanks Andres, > 1. Since the value of geqo_threshold is 12, does the geqo get automatically

activated for queries with 12 or more joins?

No, not directly. It will get used for 12 joins with no predefined order.

This is a bit complicated by the fact that even a predefined order like:
a JOIN b ON (..) JOIN c ON (..) ...
might get reordered if the number of joins is less than join_collapse_limit.

See
http://www.postgresql.org/docs/current/static/explicit-joins.html>>>>> *Oh, that is, I can't make sure that a query given by me uses the geqo. Is it?

3. How do we come to know whether the geqo has been used to solve the query
or not? Does Explain Analyze report it?

No, you cannot see it directly unless you recompile with different options.>>>>> *Recompile? Sorry, but I couldn't get this.

Please let me know these basics on the use of the geqo.

Why do you want to specifically use GEQO? Just Research? Normally you try not
to get where GEQO is used ;-)
Andres>>>>> *Yes, I know. But then yes again, its for research. Thanks,RegardsSwati