Partition and Functions

Поиск
Список
Период
Сортировка
От Leandro Guimarães
Тема Partition and Functions
Дата
Msg-id CAJV35FOECWbh4mh=QGb8k2S3t8eszuj9GRB6WdhMpYfUYwH4=g@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi Everyone,
  I have a partitioned by period table scenario here where I need to execute a query with a function in where clause. 

  I'm not sure if this is the best approach to do that, but when I use the functions, it scans all the tables instead only the desired one. If I put the parameter hardcoded, it works fine. 

  Any idea how could I solve this? Follow my query example:

SELECT customer_id, 
       date_id, 
       kpi AS kpi_value 
FROM   schema1.table1 
WHERE  date_id >= To_char(( current_date - interval '30' day ) :: DATE,'YYYYMMDD')::INTEGER 


Thanks!
Leandro Guimarães

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

Предыдущее
От: github kran
Дата:
Сообщение: Re: How many billion rows of data I can store in PostgreSQL RDS.
Следующее
От: Derek Hans
Дата:
Сообщение: Update does not move row across foreign partitions in v11