Re: When to store data that could be derived

Поиск
Список
Период
Сортировка
От Frank
Тема Re: When to store data that could be derived
Дата
Msg-id 86948961-6869-c5c3-ee40-0ffaaf2d46be@chagford.com
обсуждение исходный текст
Ответ на Re: When to store data that could be derived  (Ron <ronljohnsonjr@gmail.com>)
Ответы Re: When to store data that could be derived  (Frank <frank@chagford.com>)
Список pgsql-general

On 2019-03-25 4:06 PM, Ron wrote:
> On 3/25/19 8:15 AM, Frank wrote:
> 
> It would be interesting to see what the query planner tries to do with 
> this:
> 
> WHERE
>      CASE
>          WHEN a.tran_type = 'ar_rec' THEN y.posted
>          WHEN a.tran_type = 'cb_rec' THEN w.posted
>      END = '1'
> 

I have attached the schema showing the full VIEW definition, and the 
result of the following EXPLAIN -

EXPLAIN SELECT * FROM ccc.ar_trans WHERE cust_row_id = 4 AND tran_date 
BETWEEN '2015-06-01' AND '2015-06-30'.

Because I have used 'WHERE tran_date' in the query, and tran_date is 
also derived from a CASE expression, I imagine that will also add some 
complication.

I am running PostgreSQL 11.1 on Fedora 29.

Frank

Вложения

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: When to store data that could be derived
Следующее
От: Frank
Дата:
Сообщение: Re: When to store data that could be derived