Re: [PERFORM] Estimation row error

2015-12-18 Thread Pavel Stehule
Hi 2015-12-18 16:21 GMT+01:00 Mathieu VINCENT : > Hello, > > No one to help me to understand this bad estimation rows ? > It's *NOT* caused by : > >- correlation between columns (cross-correlation) >- bad statistics (i tried with default_statistics_target to 10 000) >- bad number of

Re: [PERFORM] Estimation row error

2015-12-18 Thread Mathieu VINCENT
Hello, No one to help me to understand this bad estimation rows ? It's *NOT* caused by : - correlation between columns (cross-correlation) - bad statistics (i tried with default_statistics_target to 10 000) - bad number of distinct values - complexe join conditions I have no more id

Re: [PERFORM] Estimation row error

2015-12-17 Thread Mathieu VINCENT
Adding foreign key between on t2 and t3, does not change the plan. drop table if exists t1; drop table if exists t2; drop table if exists t3; create table t1 as select generate_Series(1,20) as c1; create table t2 as select generate_Series(1,20)%100+1 as c1; create table t3 as select gener

Re: [PERFORM] Estimation row error

2015-12-17 Thread Mathieu VINCENT
Here, another issue with row estimate. And, in this example, there is not correlation beetween columns in a same table. drop table if exists t1; drop table if exists t2; drop table if exists t3; create table t1 as select generate_Series(1,20) as c1; create table t2 as select generate_Series(1

Re: [PERFORM] Estimation row error

2015-12-17 Thread Matteo Grolla
Thank you both for the help! happy holidays 2015-12-17 10:10 GMT+01:00 Mathieu VINCENT : > thks Gunnar, > > I removed the correlation between t3.c1 and t3.c2 in this sql script : > > drop table if exists t1; > drop table if exists t2; > drop table if exists t3; > drop table if exists t4; > > crea

Re: [PERFORM] Estimation row error

2015-12-17 Thread Mathieu VINCENT
thks Gunnar, I removed the correlation between t3.c1 and t3.c2 in this sql script : drop table if exists t1; drop table if exists t2; drop table if exists t3; drop table if exists t4; create table t1 as select generate_Series(1,30) as c1; create table t2 as select generate_Series(1,400) as c

Re: [PERFORM] Estimation row error

2015-12-15 Thread Gunnar "Nick" Bluth
Am 15.12.2015 um 10:49 schrieb Andreas Kretschmer: > Gunnar Nick Bluth wrote: > >> Am 15.12.2015 um 09:05 schrieb Mathieu VINCENT: >>> Hello, >>> >>> No one to help me to understand this bad estimation rows ? >> >> Well, >> >> on a rather beefy machine, I'm getting quite a different plan: >> http

Re: [PERFORM] Estimation row error

2015-12-15 Thread Andreas Kretschmer
Gunnar Nick Bluth wrote: > Am 15.12.2015 um 09:05 schrieb Mathieu VINCENT: > > Hello, > > > > No one to help me to understand this bad estimation rows ? > > Well, > > on a rather beefy machine, I'm getting quite a different plan: > http://explain.depesz.com/s/3y5r you are using 9.5, right? Go

Re: [PERFORM] Estimation row error

2015-12-15 Thread Gunnar "Nick" Bluth
Am 15.12.2015 um 09:05 schrieb Mathieu VINCENT: > Hello, > > No one to help me to understand this bad estimation rows ? Well, on a rather beefy machine, I'm getting quite a different plan: http://explain.depesz.com/s/3y5r Which may be related to this setting: perftest=# show default_statistics_

Re: [PERFORM] Estimation row error

2015-12-15 Thread Mathieu VINCENT
Hello, No one to help me to understand this bad estimation rows ? Mathieu VINCENT 2015-12-11 12:35 GMT+01:00 Mathieu VINCENT : > Sorry, I forget to precise Postgresql version > > 'PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 > 20120313 (Red Hat 4.4.7-11), 64-bit' >

Re: [PERFORM] Estimation row error

2015-12-11 Thread Mathieu VINCENT
Sorry, I forget to precise Postgresql version 'PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11), 64-bit' BR Mathieu VINCENT 2015-12-11 9:53 GMT+01:00 Mathieu VINCENT : > Hello, > > I would like to know how row estimation is calculed by ex

[PERFORM] Estimation row error

2015-12-11 Thread Mathieu VINCENT
Hello, I would like to know how row estimation is calculed by explain ? In my execution plan, this estimation is extremely wrong (267 instead of 198000) I reproduced this estimation error in this simple case : drop table if exists t1; drop table if exists t2; drop table if exists t3; drop table i