Re: SQL Challenge: Arbitrary Cross-tab
От | Josh Berkus |
---|---|
Тема | Re: SQL Challenge: Arbitrary Cross-tab |
Дата | |
Msg-id | 200408180956.14356.josh@agliodbs.com обсуждение исходный текст |
Ответ на | Re: SQL Challenge: Arbitrary Cross-tab (Joe Conway <mail@joeconway.com>) |
Ответы |
Re: SQL Challenge: Arbitrary Cross-tab
|
Список | pgsql-sql |
Joe, Elein: > This is pretty much exactly how contrib/tablefunc's crosstab (non-hashed > version; crosstab(sourcesql, ncols)) works. If you really need it to be > portable, though, application layer procedural code is likely to be the > easiest and fastest way to go. crosstab just wraps the procedural code > in an SRF for you. No, you're missing one factor in the spec. Timekeeper_1 for case_id = 182738 is not the same timekeeper as Timekeeper_1 for case_id = 217437. That's why traditional crosstab plans don't work. Anyway, here's the wrap-up: I tried Stephan's idea, it works, but it's so slow that we're going to to the procedural loop. Thanks, all! -- Josh Berkus Aglio Database Solutions San Francisco
В списке pgsql-sql по дате отправления: