Dev Shed Forums - PostgreSQL Help http://forums.devshed.com/ PostgreSQL Help forum discussing administration, SQL syntax, or other PostgreSQL-related topics. PostgreSQL provides enterprise level database functionality at open source prices. en Thu, 23 Nov 2017 00:23:10 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - PostgreSQL Help http://forums.devshed.com/ optimize date help http://forums.devshed.com/postgresql-help/979376-optimize-date-help-new-post.html Fri, 03 Nov 2017 14:27:37 GMT = (CURRENT_DATE - interval '15 day')::date order by a.start --------- Also I want to run this between 2...]]> I am doing a simple select but converting a date from epoch timestamp to 1 second, for last 15 days of data. What I have works fine but its very slow. Any ideas ?

Code:

select a.* from test a
where date_trunc('day', (timestamp 'epoch' + a.start * interval '1 second')) >= (CURRENT_DATE - interval '15 day')::date
order by a.start

Also I want to run this between 2 specific dates. any ideas on that one also ?

thanks for any help. ]]>
PostgreSQL Help vsql http://forums.devshed.com/postgresql-help-21/optimize-date-help-979376.html