Re: bad plan
От | Richard Huxton |
---|---|
Тема | Re: bad plan |
Дата | |
Msg-id | 422D8F0E.8000906@archonet.com обсуждение исходный текст |
Ответ на | bad plan (Gaetano Mendola <mendola@bigfoot.com>) |
Ответы |
Re: bad plan
|
Список | pgsql-performance |
Gaetano Mendola wrote: > running a 7.4.5 engine, I'm facing this bad plan: > > empdb=# explain analyze SELECT name,url,descr,request_status,url_status,size_mb,estimated_start,request_time_stamp > empdb-# FROM v_sc_user_request > empdb-# WHERE > empdb-# login = 'babinow1' > empdb-# LIMIT 10 ; > -> Subquery Scan vsp (cost=985.73..1016.53 rows=1103 width=12) (actual time=25.328..1668.754 rows=493loops=31) > -> Merge Join (cost=985.73..1011.01 rows=1103 width=130) (actual time=25.321..1666.666 rows=493loops=31) > Merge Cond: ("outer".id_program = "inner".id_program) The problem to address is in this subquery. That's a total of 31 x (1668.754 - 25.328) = 50seconds (about). Since your query is so simple, I'm guessing v_sc_user_request is a view. Can you provide the definition? -- Richard Huxton Archonet Ltd
В списке pgsql-performance по дате отправления: