Re: query efficiency - Can I speed it up?
От | Sean Davis |
---|---|
Тема | Re: query efficiency - Can I speed it up? |
Дата | |
Msg-id | 200702011233.31654.sdavis2@mail.nih.gov обсуждение исходный текст |
Ответ на | Re: query efficiency - Can I speed it up? (ann hedley <ann.hedley@ed.ac.uk>) |
Ответы |
Re: query efficiency - Can I speed it up?
|
Список | pgsql-novice |
On Thursday 01 February 2007 12:01, ann hedley wrote: > Thanks but no. I think because it's description~ (like) rather than > description= therefore it has to search the whole string in each > description. > > From the output below it seems to search the 'go' table once, cost 266, > then for each record found searches the 'gotcha' table (cost 46809). So > it's the gotcha part of the query I need to speed up, yes? > > Maybe I just need a clever bit of PHP that checks the cost and if it's > excessive asks for a more specific search string? > > Thanks > > nemdb3=# explain analyse select pept_id,description,confidence from > gotcha inner join go on (gotcha.go_term=go.go_term) where go.description > like 'tRNA acetylation' and ( spid='ALP' or spid='ASP' or spid='DIP' or > spid='GPP' ); Ann, You might think about full-text searching of the descriptions. It may be quite a bit faster than a "like" search. It may be worth looking. Sean
В списке pgsql-novice по дате отправления: