Re: Picking out the most recent row using a time stamp column
В списке pgsql-performance по дате отправления:
| От | Josh Berkus |
|---|---|
| Тема | Re: Picking out the most recent row using a time stamp column |
| Дата | |
| Msg-id | 4D670B53.70003@agliodbs.com обсуждение исходный текст |
| Ответ на | Re: Picking out the most recent row using a time stamp column (Shaun Thomas <sthomas@peak6.com>) |
| Список | pgsql-performance |
> Why did you use row_number instead of rank?
Because I assumed he only wanted one row in the event of ties.
Hmmm, although with that schema, there won't be ties. So it's pretty
much arbitrary then.
> I am now curious how the speed compares though. I still think the
> DISTINCT ON will be faster, but it would be a great surprise.
Hopefully we'll find out! The windowing functions are usually much
faster for me. I think in 9.0 or 9.1 someone replumbed DISTINCT ON to
use a bunch of the window function internals, at which point it'll cease
to matter.
--
-- Josh Berkus
PostgreSQL Experts Inc.
http://www.pgexperts.com
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера