Re: Simple join optimized badly?

Поиск
Список
Период
Сортировка
От Craig A. James
Тема Re: Simple join optimized badly?
Дата
Msg-id 452B108C.7020703@modgraph-usa.com
обсуждение исходный текст
Ответ на Re: Simple join optimized badly?  (Brian Herlihy <btherl@yahoo.com.au>)
Ответы Re: Simple join optimized badly?  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-performance
Brian Herlihy wrote:
> PG does support hints actually..
> The only thing is, the hints are expressed in an obscure, ad-hoc and
> implementation dependant language.
>
> For example, the "Don't use index X" hint (the one I used) can be accessed by
> replacing your index with an index on values derived from the actual index...

And then there's

    select ... from (select ... offset 0)

where the "offset 0" prevents any rewriting between the two levels of query.  This replaces joins and AND clauses where
theplanner makes the wrong choice of join order or filtering.  I grepped my code and found four of these (all
workaroundsfor the same underlying problem). 

Imagine I got run over by a train, and someone was reading my code.  Which would be easier for them to maintain: Code
withweird SQL, or code with sensible, well-written SQL and explicit hints?  Luckily for my (hypothetical, I hope)
successor,I put massive comments in my code explaining the strange SQL. 

The bad applications are ALREADY HERE.  And they're WORSE to maintain than if we had a formal hint language.  The
argumentthat hints lead to poor application is true.  But lack of hints leads to worse applications. 

Craig


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

Предыдущее
От: Brian Herlihy
Дата:
Сообщение: Re: Simple join optimized badly?
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Simple join optimized badly?