Re: [HACKERS] Much Ado About COUNT(*)
От | Greg Stark |
---|---|
Тема | Re: [HACKERS] Much Ado About COUNT(*) |
Дата | |
Msg-id | 877jmhxr9d.fsf@stark.xeocode.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Much Ado About COUNT(*) (Csaba Nagy <nagy@ecircle-ag.com>) |
Ответы |
Re: [HACKERS] Much Ado About COUNT(*)
Re: [HACKERS] Much Ado About COUNT(*) |
Список | pgsql-general |
Csaba Nagy <nagy@ecircle-ag.com> writes: > [snip] > > The database could be clever and implement the same kind of sampling vacuum > > does. That picks a random sampling of pages from the table without using an > > index. But there's no way to implement the same kind of behaviour from the > > user-visible features. > ... meaning perhaps a new keyword accepted by SELECT, something like > "SAMPLE 1000" ? Which would mean sample records in a 1:1000 ratio ? > Would simplify (and probably speed up a lot) some estimating queries... See: http://www.jlcomp.demon.co.uk/faq/random.html I think the Oracle syntax looks like SELECT * FROM foo SAMPLE (0.1) I don't think I would have picked this syntax but it seems like a better idea to copy the existing practice rather than invent a new one. There are some details, like what to do when there's a WHERE clause or joins. Oracle disallows joins entirely and I'm unclear what the best thing to do about where clauses would be. -- greg
В списке pgsql-general по дате отправления: