Re: BUG #2381: LIMIT 1 very very lazy than without

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: BUG #2381: LIMIT 1 very very lazy than without
Дата
Msg-id e1ci2d$dfe$1@news.hub.org
обсуждение исходный текст
Ответ на BUG #2381: LIMIT 1 very very lazy than without  ("Peter Krauss" <krauss@i-node.com.br>)
Список pgsql-bugs
""Peter Krauss"" <krauss@i-node.com.br> wrote
>
> The single query (on psql) is fary fast
> (less than 1 sec)
>
>  SELECT a,b,c,d FROM products_view WHERE
>  sku='0-123-0-0-6024-20'
>  OR lower(codfornecedor)=lower('0-123-0-0-6024-20')
>  OR lower(eanfor)=lower('0-123-0-0-6024-20')
>  OR lower(refprodfornecedor)=lower('0-123-0-0-6024-20');
>  -- ~0.1 second
>
> BUT, IF I ADD a "LIMIT 1", it consumes 2 minutes!
>
>  SELECT a,b,c,d FROM products_view WHERE
>  sku='0-123-0-0-6024-20'
>  OR lower(codfornecedor)=lower('0-123-0-0-6024-20')
>  OR lower(eanfor)=lower('0-123-0-0-6024-20')
>  OR lower(refprodfornecedor)=lower('0-123-0-0-6024-20')
>  LIMIT 1;
> -- ~ 2 minutes !!
>

Can you post the \d of products_view and EXPLAIN ANALYZE results of these
two queries from psql?

Regards,
Qingqing

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2383: MessageBox Win32 API makes clients freeze
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: BUG #2382: Fail ODBC Connection