From: | "Dann Corbit" <DCorbit(at)connx(dot)com> |
---|---|
To: | "Dann Corbit" <DCorbit(at)connx(dot)com>, "Hrishikesh Deshmukh" <hdeshmuk(at)gmail(dot)com>, "Postgresql-General" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Statistics with PostgreSQL |
Date: | 2005-03-18 23:13:23 |
Message-ID: | D425483C2C5C9F49B5B7A41F89441547055A0E@postal.corporate.connx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
/* On the test stub: */
[snip]
double data[30];
int main(void)
{
size_t i;
size_t size = sizeof(data) / sizeof(data[0]);
for (i = 0; i < size; i++) {
data[i] = rand();
}
for (i = 0; i < size; i++) {
cout << data[i] << endl;
}
cout << "1st item is " << RandomSelect(data, 0, size - 1, 0) <<
endl;
cout << "2nd item is " << RandomSelect(data, 0, size - 1, 1) <<
endl;
cout << "3rd item is " << RandomSelect(data, 0, size - 1, 2) <<
endl;
for (i = 4; i < size; i++)
cout << i << "th item is " << RandomSelect(data, 0, size - 1,
i) << endl;
return 0;
}
/*
The positions are cardinal, so the first three queries above should be:
cout << "1st item is " << RandomSelect(data, 0, size - 1, 1) <<
endl;
cout << "2nd item is " << RandomSelect(data, 0, size - 1, 2) <<
endl;
cout << "3rd item is " << RandomSelect(data, 0, size - 1, 3) <<
endl;
*/
From | Date | Subject | |
---|---|---|---|
Next Message | Fernando Lujan | 2005-03-18 23:28:50 | Vaccum analyze. |
Previous Message | Mark Rae | 2005-03-18 23:00:27 | Re: SMP scaling |