Re: Gsoc2012 Idea --- Social Network database schema

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Gsoc2012 Idea --- Social Network database schema
Дата
Msg-id 1481.1332344098@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Gsoc2012 Idea --- Social Network database schema  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Gsoc2012 Idea --- Social Network database schema
Re: Gsoc2012 Idea --- Social Network database schema
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Well, the standard syntax apparently aims to reduce the number of
> returned rows, which ORDER BY does not.  Maybe you could do it with
> ORDER BY .. LIMIT, but the idea here I think is that we'd like to
> sample the table without reading all of it first, so that seems to
> miss the point.

I think actually the traditional locution is more likeWHERE random() < constant
where the constant is the fraction of the table you want.  And yeah,
the presumption is that you'd like it to not actually read every row.
(Though unless the sampling density is quite a bit less than 1 row
per page, it's not clear how much you're really going to win.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Proposal: PL/pgPSM for 9.3
Следующее
От: Qi Huang
Дата:
Сообщение: Re: Gsoc2012 Idea --- Social Network database schema