From: | Charlie Savage <cfis(at)savagexi(dot)com> |
---|---|
To: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: ERROR: Gin doesn't support full scan due to it's awful |
Date: | 2006-09-06 07:59:42 |
Message-ID: | 44FE7FEE.5070003@savagexi.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks for the clarification Teodor - it makes much more sense now.
I'd agree the error message is confusing, particularly since this works:
set enable_seqscan to on;
set enable_indexscan to off;
set enable_bitmapscan to off;
select *
from test.features
where to_tsquery('') @@ features.vector;
I see why it would now. But it would be nice if the message mentioned
the root cause of the problem - that the tsquery value does not contain
any lexemes and thus is not valid for doing a search.
Thanks,
Charlie
Teodor Sigaev wrote:
>> 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.
>
From | Date | Subject | |
---|---|---|---|
Next Message | Teodor Sigaev | 2006-09-06 08:11:00 | Re: ERROR: Gin doesn't support full scan due to it's awful |
Previous Message | Ivan Sergio Borgonovo | 2006-09-06 07:59:03 | Re: constraint -- one or the other column not null |