Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: EXPLAIN det...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 3977 of 4424
Post > Topic >>

Re: EXPLAIN detail

by richard.broersma@[EMAIL PROTECTED] ("Richard Broersma") Apr 9, 2008 at 03:17 PM

On Wed, Apr 9, 2008 at 11:41 AM, PFC <lists@[EMAIL PROTECTED]
> wrote:
>        In order to use the index, you could rewrite it as something like
:
>        a.calldate >= '2008-04-09' AND a.calldate < ('2008-04-09'::DATE +
'1
> DAY'::INTERVAL)
>        This is a RANGE query (just like BETWEEN) which is
index-friendly.

Another option would be to create a functional index on date_trunc(
'day', cdr.calldate)

then using a where condition like:

date_trunc(a.calldate) = '2008-04-09'

would definitely use an index.


-- 
Regards,
Richard Broersma Jr.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 4 Posts in Topic:
Re: EXPLAIN detail
npuleio@[EMAIL PROTECTED]  2008-04-09 07:44:23 
Re: EXPLAIN detail
craig@[EMAIL PROTECTED]   2008-04-09 23:28:51 
Re: EXPLAIN detail
lists@[EMAIL PROTECTED]   2008-04-09 20:41:29 
Re: EXPLAIN detail
richard.broersma@[EMAIL P  2008-04-09 15:17:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 8:43:20 CST 2008.