Re: check constraint question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: check constraint question
Дата
Msg-id 10870.1201189677@sss.pgh.pa.us
обсуждение исходный текст
Ответ на check constraint question  ("Tim Rupp" <caphrim007@gmail.com>)
Ответы Re: check constraint question  ("Tim Rupp" <caphrim007@gmail.com>)
Список pgsql-general
"Tim Rupp" <caphrim007@gmail.com> writes:
> ... a bunch of inherited tables that have the following constraint

> CHECK (start_time >= '2008-01-01'::date AND end_time < '2008-01-01'::date)

> and when i do the same query (as in the documentation) on the table, I
> get a bunch of sequential scans in the planner, and it appears to
> ignore my constraints

> netflow=# explain SELECT count(*) FROM flows WHERE start_time >= DATE
> '2008-01-23' AND end_time < '2008-01-26'::date;

I don't think you've thought this through carefully.  That WHERE
condition is not inconsistent with that CHECK constraint, ie, there
could be some rows in the table that meet the WHERE.  In fact,
a set of constraints of this form don't represent a unique partitioning
do they?  (They might if you added the additional constraint that
start_time <= end_time, but that's not explicit here.)

            regards, tom lane

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Getting all tables into memory
Следующее
От: User Map
Дата:
Сообщение: change the default data directory