If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

To find total distinct cookies for each date is an easy part, but the problem is to find new cookies(that means one never appeared before compares to all the ones appeared up until now), it takes forever to run (with more than 8 million rows).

To find distinct new cookies I wrote:
____________________________________________________________
select distinct trunc(logdate),cookieid from weblog w1
where not exisits(select 1 from weblog w2 where w1.cookieid=w2.cookieid and trunc(logdate)<=trunc(logdate-1)
____________________________________________________________

note:I also created non-unique index on 'cookieid'.

This query takes forever, so can someone help me here?
What's the best way to make one such report?