*** pgsql/src/backend/commands/analyze.c 2008/11/10 00:49:37 1.128 --- pgsql/src/backend/commands/analyze.c 2008/12/13 19:13:44 1.129 *************** *** 8,14 **** * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.127 2008/11/02 01:45:27 tgl Exp $ * *------------------------------------------------------------------------- */ --- 8,14 ---- * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.128 2008/11/10 00:49:37 tgl Exp $ * *------------------------------------------------------------------------- */ *************** typedef struct AnlIndexData *** 67,73 **** /* Default statistics target (GUC parameter) */ ! int default_statistics_target = 10; /* A few variables that don't seem worth passing around as parameters */ static int elevel = -1; --- 67,73 ---- /* Default statistics target (GUC parameter) */ ! int default_statistics_target = 100; /* A few variables that don't seem worth passing around as parameters */ static int elevel = -1; *************** std_typanalyze(VacAttrStats *stats) *** 1531,1540 **** * error in bin size f, and error probability gamma, the minimum * random sample size is * r = 4 * k * ln(2*n/gamma) / f^2 ! * Taking f = 0.5, gamma = 0.01, n = 1 million rows, we obtain * r = 305.82 * k * Note that because of the log function, the dependence on n is ! * quite weak; even at n = 1 billion, a 300*k sample gives <= 0.59 * bin size error with probability 0.99. So there's no real need to * scale for n, which is a good thing because we don't necessarily * know it at this point. --- 1531,1540 ---- * error in bin size f, and error probability gamma, the minimum * random sample size is * r = 4 * k * ln(2*n/gamma) / f^2 ! * Taking f = 0.5, gamma = 0.01, n = 10^6 rows, we obtain * r = 305.82 * k * Note that because of the log function, the dependence on n is ! * quite weak; even at n = 10^12, a 300*k sample gives <= 0.66 * bin size error with probability 0.99. So there's no real need to * scale for n, which is a good thing because we don't necessarily * know it at this point.