Re: Query Performance

Поиск
Список
Период
Сортировка
От sivapostgres@yahoo.com
Тема Re: Query Performance
Дата
Msg-id 96197456.387057.1663392505315@mail.yahoo.com
обсуждение исходный текст
Ответы Re: Query Performance  (Ron <ronljohnsonjr@gmail.com>)
Re: Query Performance  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
Hello,

My query is like this   

Select a.field1, a.field2, a.field3
From   (Select a.field1, b.field2, c.field3
        From   table1 a
        Join   table2 b
        on     b.something = a.something
        Join   table3 c
        On     c.something = a.something 
        Where  a.field7 = 'value'

        UNION ALL

        Select a.field4, a.field5, a.field6
        From   table11 a
        Join   table21 b
        On     b.something = a.something
        Where  a.field8 = 'something' ) a
Join   table10 b
On     b.field11 = (Select c.field11
                    From   table10 c
                    Where  c.field10 = a.field1 )                     <- instead of a.field1, if I hardcode value (eg. '100') query runs faster
Join   table21 c
On     c.something = a.something
...


In the above query, If I substitute a value for a.field1, query runs faster.   
Any suggestion/guidance/links to improve the query performance without substituting the value ?

Happiness Always
BKR Sivaprakash


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

Предыдущее
От: Ganesh Korde
Дата:
Сообщение: Re: get user info on log
Следующее
От: Ron
Дата:
Сообщение: Re: Query Performance