Search Postgresql Archives

Partition and Functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux