Unix Technical Forum

Re: Too slow querying a table of 15 million records

This is a discussion on Re: Too slow querying a table of 15 million records within the Pgsql Performance forums, part of the PostgreSQL category; --> > database=> explain select date_trunc('hour', time),count(*) as total from > test where p1=53 and time > now() - interval ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 11:58 AM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: Too slow querying a table of 15 million records

> database=> explain select date_trunc('hour', time),count(*) as total from
> test where p1=53 and time > now() - interval '24 hours' group by
> date_trunc order by date_trunc ;


Try going:

time > '2005-06-28 15:34:00'

ie. put in the time 24 hours ago as a literal constant.

Chris


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:17 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com