Thread: select query optimization

select query optimization

From
sergey
Date:
Hi all!
i run this query

select f1,f2
from t1,t2
where
t1.url_id=t2.entry_id and
(t1.entry_stamp::date>=(now()::date-interval '14 days')) and
....

the problem is that t1 is a very big table so the query is too slow.
what if i move the second condition to where-clause. Can this reduce the 
select time?

select f1,f2
from (select * from t1 where t1.entry_stamp::date>=(now()::date-interval 
'14 days' ) as t1,t2
where
t1.url_id=t2.entry_id and
....

Does this makes sense?
(tried to make explain analyze, but it takes too much time)

Thank you.