Re: Where can I get the number of plans that considered by Planner?

From: 纪晓曦 <sheepjxx(at)gmail(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>, "?????????" <sheepjxx(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Where can I get the number of plans that considered by Planner?
Date: 2009-10-12 11:53:19
Message-ID: 37a11ce00910120453h3665653r39126ea678e1c3c6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it a reasonable idea to add a counter to set_cheapest? I think this
function evaluate the cheapest path. Therefore, it means how many complete
plans have been considered, doesn't it?

2009/10/12 纪晓曦 <sheepjxx(at)gmail(dot)com>

> What I want to count is the number of plans that have been considered
> cheapest_path. Since if a path is considered to be a cheapest_path, the
> postgres optimizer need to spent time on comparison. I think this is what I
> want.
>
> 2009/10/4 Martijn van Oosterhout <kleptog(at)svana(dot)org>
>
>> On Sat, Oct 03, 2009 at 04:20:59PM +1000, ????????? wrote:
>> > Since I also need to consider gego, is this the best way to do it?
>>
>> I think you need to be clearer about what you're trying to count.
>> Consider a nestjoin plan where:
>>
>> - For the inner side it considers 7 paths and throws away 4.
>> - For the outer side it considers 6 paths and throws away 2.
>>
>> Do you want the number 3*4=12 or 7*6=42? Or something in between (what
>> if in addition to a nestjoin plan otther possibilities are possible).
>>
>> As you can see, you can't talk about complete plans because they don't
>> exist until right at the end, until then it's just considering how to
>> combine different paths in sensible ways.
>>
>> Have a nice day,
>> --
>> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
>> > Please line up in a tree and maintain the heap invariant while
>> > boarding. Thank you for flying nlogn airlines.
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (GNU/Linux)
>>
>> iD8DBQFKyIiaIB7bNG8LQkwRAklcAJsFBOQE/xAscZm0ok4WwxVh+C6x8ACfYuNz
>> G4GpDdQ4IuTXGWc5QHhD5dc=
>> =ynTH
>> -----END PGP SIGNATURE-----
>>
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2009-10-12 12:04:42 Re: auth problem
Previous Message 纪晓曦 2009-10-12 11:42:44 Re: Where can I get the number of plans that considered by Planner?