![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
erland - I don't quite get what you are doing with creating and dropping a table and a view? |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
I'm still mildly puzzled as to how an indexed view would be quicker to function than going straight to the table. Surely there's exactly the same amount of work to be done? I'll check it out though and let you know if it's any quicker. Thanks Tim |
#6
| |||
| |||
|
|
If you want more help, I suggest you give us a complete DDL of your database, some real example data and perhaps we can do better. |
#7
| |||
| |||
|
|
I'm still mildly puzzled as to how an indexed view would be quicker to function than going straight to the table. Surely there's exactly the same amount of work to be done? |
#8
| ||||
| ||||
|
|
If you want more help, I suggest you give us a complete DDL of your database, some real example data and perhaps we can do better. The requirement is simply this... I have a lot of pages and I want to record when each is visited. I then need to be able to answer questions like this... |
|
"Which was the most popular page in January 07?" "Which are the top 10 most viewed pages between 2 and 3 in the afternoon" with unlimited segmenting of the data really. So I thought I would record an entry in a table everytime a page is viewed, along with the date and time. Using some simple queries using "count(*)", a where clause and a group by clause I was answering all the questions. Trouble is the speed. Several million records (and growing rapidly) and count(*) gets slow. |
|
Just while I was writing this I had an idea - I could move a finished month's data to another table, so each month has a table of data. It might still be a million records though, but at least it wont get worse and worse over time. This would make some results harder to get like "most viewed page of all time" but my monthy, hourly, weekly figures would be quicker. Any other tips? |
|
Thanks |
#9
| |||
| |||
|
|
I have a lot of pages and I want to record when each is visited. I then need to be able to answer questions like this... "Which was the most popular page in January 07?" "Which are the top 10 most viewed pages between 2 and 3 in the afternoon" with unlimited segmenting of the data really. So I thought I would record an entry in a table everytime a page is viewed, along with the date and time. Using some simple queries using "count(*)", a where clause and a group by clause I was answering all the questions. Trouble is the speed. Several million records (and growing rapidly) and count(*) gets slow. |
|
Just while I was writing this I had an idea - I could move a finished month's data to another table, so each month has a table of data. It might still be a million records though, but at least it wont get worse and worse over time. This would make some results harder to get like "most viewed page of all time" but my monthy, hourly, weekly figures would be quicker. |
![]() |
| Thread Tools | |
| Display Modes | |
| |