select query optimization

Поиск
Список
Период
Сортировка
От sergey
Тема select query optimization
Дата
Msg-id 44D3983F.60503@gmail.com
обсуждение исходный текст
Список pgsql-sql
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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Jonathan Sinclair"
Дата:
Сообщение:
Следующее
От: "Melvin Davidson"
Дата:
Сообщение: to_dec()