Re: ERROR: Gin doesn't support full scan due to it's awful

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: ERROR: Gin doesn't support full scan due to it's awful
Дата
Msg-id 44FE7BF6.8090407@sigaev.ru
обсуждение исходный текст
Ответ на Re: ERROR: Gin doesn't support full scan due to it's awful  (Charlie Savage <cfis@savagexi.com>)
Ответы Re: ERROR: Gin doesn't support full scan due to it's awful  (Charlie Savage <cfis@savagexi.com>)
Список pgsql-general
> explain analyze
> select *
> from test.features
> where to_tsquery('') @@ features.vector
>
> ERROR:  Gin doesn't support full scan due to it's awful inefficiency

Look:
contrib_regression=# select '{1,2,3}'::int4[] @ '{}';  --contains
  ?column?
----------
  t
(1 row)

contrib_regression=# select '{1,2,3}'::int4[] && '{}'; --overlap
  ?column?
----------
  f
(1 row)

contrib_regression=# select to_tsvector('asdasd') @@ ''::tsquery;
NOTICE:  query doesn't contain lexeme(s)
  ?column?
----------
  f
(1 row)

Semantic of different operation with void (but not NULL) argument is very
different. If query doesn't contain any entry (returned by extractQuery() index
support method), then GIN, in any case, doesn't know what it should return:
whole set of pointers or nothing. But GIN can't return all - it will be
very-very slow, because there is a lot of pointers in GIN index to each table's row.

It seems to me that message makes confuse about reason of error...



>
> Interestingly this works:
>
> explain analyze
> select *
> from test.features
> where NULL @@ features.vector

That is because @@ is marked as 'returns NULL on NULL input', ie index will not
be used.

--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

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

Предыдущее
От: "Dawid Kuroczko"
Дата:
Сообщение: Re: constraint -- one or the other column not null
Следующее
От: zeljko
Дата:
Сообщение: Re: compressed protocol