BUG #4800: constraint_exclusion could be smarter with bool conversion

Поиск
Список
Период
Сортировка
От Alex
Тема BUG #4800: constraint_exclusion could be smarter with bool conversion
Дата
Msg-id 200905081036.n48AaITQ052818@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4800: constraint_exclusion could be smarter with bool conversion
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4800
Logged by:          Alex
Email address:      alex@xdcom.org
PostgreSQL version: 8.3.6
Operating system:   rhel5
Description:        constraint_exclusion could be smarter with bool
conversion
Details:

Table "public.foo1"
Column       |          Type          |     Modifiers
-------------+------------------------+--------------------
 val         | character varying(16)  | not null
 mask        | integer                | default 0
Check constraints:
    "foo_1_mask_check" CHECK (mask = 1)
Inherits: foo

=> EXPLAIN select * from foo1 where mask >1;
                QUERY PLAN
------------------------------------------
 Result  (cost=0.00..0.01 rows=1 width=0)
   One-Time Filter: false
(2 rows)

=> EXPLAIN select * from foo1 where (mask &2)::bool;
                           QUERY PLAN
-----------------------------------------------------------------
 Seq Scan on foo1  (cost=0.00..100.32 rows=896 width=59)
   Filter: ((mask & 2))::boolean
(2 rows)


There many children of table foo like foo1,..fooN. with different
check(mask=2^N).
I wish constraint_exclusion to be smarter with bool conversion so that
'select * from foo where (mask&5)::bool' can be faster;

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

Предыдущее
От: "Alex"
Дата:
Сообщение: BUG #4799: BitMapAnd never works with gin
Следующее
От: "Peter Much"
Дата:
Сообщение: BUG #4801: Performance failure: 600 MB written to each WAL log