473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I got bit by that darn GEQO setting again...

I know Tom would like a definitive and thorough testing to determine the
proper GEQO threshold limit , and that is the right thing to do, of course.

But just as a quick notice to those upgrading from 7.3 to 7.4 with fully
normalized databases requiring > 11 joins, the GEQO setting can be a
killer...

How about a TIP:

"For large number of joins, test whether the GEQO settings are right for
you"

Mike Mascari

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #1
6 1593
Mike Mascari <ma*****@mascari.com> writes:
But just as a quick notice to those upgrading from 7.3 to 7.4 with fully
normalized databases requiring > 11 joins, the GEQO setting can be a
killer...


Uh ... dare I ask whether you think it's too high? Or too low?

regards, tom lane

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

Nov 22 '05 #2
> Mike Mascari <ma*****@mascari.com> writes:
But just as a quick notice to those upgrading from 7.3 to 7.4 with
fully
normalized databases requiring > 11 joins, the GEQO setting can be a
killer...


Uh ... dare I ask whether you think it's too high? Or too low?


Just a data point: With a fresh 7.4 and

geqo=on
geqo_threshold=11
geqo_generations=0
geqo_effort=1
geqo_pool_size=0
geqo_selection_bias=2

a 12 table join was taking a whole second to plan until I manually
connected the tables (now it's in the order of a few ms).

I figure geqo had kicked in at that point.

d.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #3
Tom Lane wrote:
Mike Mascari <ma*****@mascari.com> writes:

But just as a quick notice to those upgrading from 7.3 to 7.4 with fully
normalized databases requiring > 11 joins, the GEQO setting can be a
killer...


Uh ... dare I ask whether you think it's too high? Or too low?

Too low. In fact, after testing some of my queries which are a bit large
(# of tables) in size, I usually just wind up turning it off. I know
that's insufficient evidence to do anything, but I have yet to stumble
upon a query where GEQO performs better. Do the ODSL folks run their
performance tests with it on? off? both? I'm sorry I haven't had the
time to develop a rigorous test... :-(

Mike Mascari

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #4
Mike Mascari <ma*****@mascari.com> writes:
Tom Lane wrote:
Uh ... dare I ask whether you think it's too high? Or too low?

Too low. In fact, after testing some of my queries which are a bit large
(# of tables) in size, I usually just wind up turning it off.


Well, that's why it's configurable ;-). But don't you find that it
takes a long time to plan the larger queries? How many tables are
involved, exactly?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 22 '05 #5
Tom Lane wrote:
Mike Mascari <ma*****@mascari.com> writes:

Tom Lane wrote:

Uh ... dare I ask whether you think it's too high? Or too low?
Too low. In fact, after testing some of my queries which are a bit large
(# of tables) in size, I usually just wind up turning it off.


Well, that's why it's configurable ;-).

True!
But don't you find that it
takes a long time to plan the larger queries? How many tables are
involved, exactly?

Well, this particular query uses a UNION where the first SELECT query is
composed of an 11-way join, and the second 5. So it is not testing the
64-way join scenario. From memory, the most joins I execute in a single
query is in the low twenties. In those scenerios, I had used explicit
join syntax to improve planning time.

I ran a crude script to test the differences in planning time (EXPLAIN)
and execution time (EXPLAIN ANALYZE). I wanted to do the ANALYZE as well
since the plans generated were different and I feared the GEQO generated
plan may be the actual cause of the sluggishness, instead of the actual
planning. The script just feeds the SQL to psql, so I know it is timing
the client, connection costs, psql formatting, etc...a.k.a. crude. But
as you can see, over ten runs for each category, GEQO loses big. I get
(in seconds):

label | count | avg | stddev
-----------------+-------+--------+---------------------
NO GEQO PLAN | 10 | 0.8809 | 0.00564604089409752
NO GEQO ANALYZE | 10 | 1.1534 | 0.0093594871654564
GEQO PLAN | 10 | 3.0127 | 0.119783183757633
GEQO ANALYZE | 10 | 6.0446 | 2.50524499578163

Mike Mascari

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #6
Mike Mascari <ma*****@mascari.com> writes:
as you can see, over ten runs for each category, GEQO loses big. I get
(in seconds): label | count | avg | stddev
-----------------+-------+--------+---------------------
NO GEQO PLAN | 10 | 0.8809 | 0.00564604089409752
NO GEQO ANALYZE | 10 | 1.1534 | 0.0093594871654564
GEQO PLAN | 10 | 3.0127 | 0.119783183757633
GEQO ANALYZE | 10 | 6.0446 | 2.50524499578163


Interesting. I'd expect that GEQO might sometimes not pick a good plan
(it is a quasi-random search after all, and could miss the best plan).
The large stddev for the last row shows that you don't always get the
same plan, which is expected.

But those numbers say it is actually slower in choosing a plan than the
regular planner. This should definitely not be the case --- there's no
point at all in GEQO if it doesn't save planning time.

Can you send me the exact query being tested here, as well as the
database schema (pg_dump -s)?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Lochness | last post by:
I'm hoping someone can help me with this. I've seen and tried various solutions I've seen on the net, but nothing works. Of course it works perfectly on localhost, but when I upload it to the...
8
by: JamesBV | last post by:
My PC's Region setting is set to "English (Canada)"... cause I am in Canada (eh?) (: I'm using VB.net, standard edition (v1?) So I wrote my application based on this Region. I've both Short...
4
by: Umesh | last post by:
Hi all I am trying to change the printer(like paper source ,etc) setting in C#. But i am unable to do it. I am not sure how to do it. should i have to use WIN API like Openprinter , getprinter ,...
1
by: | last post by:
Hi, I am loading some crystal reports in a method similar to this (see below). And set the cursor to waiting while the reoprt is loaded, run and shown. BUT while the report is running the cursor...
6
by: Bob | last post by:
I'm trying to prevent the beep when the tab key is pressed. It works ok on XP but windows 2000 is ding ding ding Here is my code: Protected Overrides Function ProcessDialogKey(ByVal keyData As...
4
by: Bernd Helmle | last post by:
I am currently searching some resources, why and where the PostgreSQL GEQO-Engine improves large join queries. The theoretical background is clear, but i need some real life szenarios, where the...
5
by: Bob | last post by:
Vs2003, Winform app, trying to read an application setting Dim MyAppMgr as new System.configuration.AppsettingsReader Me.textbox1.text = MyAppMgr.Getvalue("MyServerName",string) Now when I...
1
by: simon | last post by:
I have an unbound RTF2 control in an Access 2003 form which I set to show either unformatted text or else text with words and sentences highlighted. I do this by setting the PlainText property,...
0
by: Jerry Spivey | last post by:
Hi, I'm a SQL Server DBA and I'm trying to get a listing of the SQL Servers on the network. I installed Visual Basic 2005 Express edition and used the SQL Server 2005 ServerInfo sample which...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.