Re: Query Performance
От | Ron |
---|---|
Тема | Re: Query Performance |
Дата | |
Msg-id | ab198555-1b4a-521f-d5a1-2674852b5e35@gmail.com обсуждение исходный текст |
Ответ на | Re: Query Performance ("sivapostgres@yahoo.com" <sivapostgres@yahoo.com>) |
Список | pgsql-general |
On 9/17/22 00:28, sivapostgres@yahoo.com wrote:
Is there an index on table1.field1?
Have you vacuumed or analyzed table1 lately?
Have you decomposed the query into the smallest possible query that demonstrates the problem?
Hello,My query is like thisSelect a.field1, a.field2, a.field3From (Select a.field1, b.field2, c.field3From table1 aJoin table2 bon b.something = a.somethingJoin table3 cOn c.something = a.somethingWhere a.field7 = 'value'UNION ALLSelect a.field4, a.field5, a.field6From table11 aJoin table21 bOn b.something = a.somethingWhere a.field8 = 'something' ) aJoin table10 bOn b.field11 = (Select c.field11From table10 cWhere c.field10 = a.field1 ) <- instead of a.field1, if I hardcode value (eg. '100') query runs fasterJoin table21 cOn 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 ?
Is there an index on table1.field1?
Have you vacuumed or analyzed table1 lately?
Have you decomposed the query into the smallest possible query that demonstrates the problem?
--
Angular momentum makes the world go 'round.
Angular momentum makes the world go 'round.
В списке pgsql-general по дате отправления: