Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-26 Thread Andy Fan
On Sat, Sep 26, 2020 at 1:51 PM Julien Rouhaud wrote: > On Sat, Sep 26, 2020 at 8:17 AM Andy Fan wrote: > > > > As for the testing with cache considered, I found how to estimate cache > hit > > ratio is hard or how to control a hit ratio to test is hard. Recently I > am thinking > > a method tha

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-25 Thread Julien Rouhaud
On Sat, Sep 26, 2020 at 8:17 AM Andy Fan wrote: > > As for the testing with cache considered, I found how to estimate cache hit > ratio is hard or how to control a hit ratio to test is hard. Recently I am > thinking > a method that we can get a page_reads, shared_buffer_hit from pg_kernel > and t

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-25 Thread Andy Fan
On Fri, Sep 25, 2020 at 5:15 PM Ashutosh Bapat wrote: > On Tue, Sep 22, 2020 at 10:57 AM Andy Fan > wrote: > > > > > > My tools set the random_page_cost to 8.6, but based on the fio data, it > should be > > set to 12.3 on the same hardware. and I do see the better plan as well > with 12.3. > >

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-25 Thread Ashutosh Bapat
On Tue, Sep 22, 2020 at 10:57 AM Andy Fan wrote: > > > My tools set the random_page_cost to 8.6, but based on the fio data, it > should be > set to 12.3 on the same hardware. and I do see the better plan as well with > 12.3. > Looks too smooth to believe it is true.. > > The attached result_fio

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-21 Thread Andy Fan
> > > It's probably worth testing on various other storage systems to see >> how that applies to those. >> >> Yes, I can test more on new hardware once I get it. Now it is still in > progress. > However I can only get a physical machine with SSD or Virtual machine with > SSD, other types are hard

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-21 Thread Andy Fan
Thanks Ashutosh for coming:) On Mon, Sep 21, 2020 at 9:03 PM Ashutosh Bapat wrote: > On Mon, Sep 21, 2020 at 9:11 AM Andy Fan wrote: > > > > Here are some changes for my detection program. > > > > | | seq_read_lat (us) | > random_read_lat (us) | >

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-21 Thread Ashutosh Bapat
On Mon, Sep 21, 2020 at 9:11 AM Andy Fan wrote: > > Here are some changes for my detection program. > > | | seq_read_lat (us) | > random_read_lat (us) | > | FIO |12 | >14

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-20 Thread Andy Fan
Hi Tomas: Thanks for checking. On Fri, Sep 18, 2020 at 9:50 PM Tomas Vondra wrote: > >I recently tried something in this direction and the result looks > >promising based on my limited test. > > > >Since the unit of a xxx_cost is "seq_page_cost", then how to detect > >seq_page_cost is importa

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-18 Thread Tomas Vondra
On Fri, Sep 18, 2020 at 09:28:10PM +0800, Andy Fan wrote: On Thu, Nov 28, 2019 at 12:48 AM Tomas Vondra wrote: On Tue, Nov 26, 2019 at 08:59:22AM +0800, Andy Fan wrote: >The optimizer cost model usually needs 2 inputs, one is used to represent >data distribution and the other one is used to r

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2019-11-27 Thread Tomas Vondra
On Tue, Nov 26, 2019 at 08:59:22AM +0800, Andy Fan wrote: The optimizer cost model usually needs 2 inputs, one is used to represent data distribution and the other one is used to represent the capacity of the hardware, like cpu/io let's call this one as system stats. In Oracle database, the sys

Dynamic gathering the values for seq_page_cost/xxx_cost

2019-11-25 Thread Andy Fan
The optimizer cost model usually needs 2 inputs, one is used to represent data distribution and the other one is used to represent the capacity of the hardware, like cpu/io let's call this one as system stats. In Oracle database, the system stats can be gathered with dbms_stats.gather_system_stat