Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Question about a blog site: STATISTICAL Records

Author  Topic 

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-08 : 15:37:43
hello,
I was wondering about sql queries on a blog site.

When u have pages that show the total amount of records and statistics of number of posts, users etc

Is it wise to run fresh queries to count these records or use a SP to update a statistical table ? And then run a select statement to show the number of records ?

Afrika

X002548
Not Just a Number

15586 Posts

Posted - 2005-11-08 : 15:51:40
[whooosh]
huh?
[/whooosh]


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-08 : 16:16:34
What am trying to say simply is :

CASE STUDY: a site like sqlteam.com

when users post threads, it shows how many threads each user posts etc, some forums tell date joined etc

Am wondering if each page queries and counts the number of posts afresh each time or simple just updates a table with the number of posts each time ? ???

Does this clarify my question
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-08 : 16:18:31
eg

X002548 8009
afrika 559




etc
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-11-08 : 16:33:40
It depends how accurate you want it to be. I can't comment on the snitz code, so I can't say how sqlteam.com does it. But what I can say is that if you want it to be accurate, then you'd have to query each time the page loads. If however, you don't mind a one minute delay, then store it in a table. Storing it in a table would allow the page to load faster as it wouldn't have to do the aggregates, rather it would just pull up the data in the stats table.

Tara Kizer
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2005-11-08 : 16:40:48
You can download the forum software that we use (http://forum.snitz.com/).

Almost all the counts are stored in summary tables. Imagine if the home page of the forums had to scan the two largest tables in the database each time it displayed.

For example, each row in the topic table includes fields for number of replies, number of times read, date of last reply and which member made the last reply. Basically all the column you'd see on this page (http://www.sqlteam.com/forums/forum.asp?FORUM_ID=5). Earlier versions of the software didn't have this summary information. It was added for performance reasons.

The query (or stored proc or ASP page) that posts a new reply also updates all relevant counters and summary information. There is also a separate batch update that updates summary information for all posts (which I've never run).

If you have more specific questions I'd be happy to try to answer them.

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-08 : 16:42:46
quote:
Originally posted by graz

You can download the forum software that we use (http://forum.snitz.com/).




Amazing ?

would do so asap
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-09 : 03:06:27
Thanks a million Graz, Tara
this info is very well appreciated.

It is really helpful

Ehi
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-11 : 03:27:13
Hey Graz !
how about the graphics ?

esp the burning gif i really think thats so cool
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-11 : 03:36:01
The topics with 20 or more replies will have that icon. You can show that burning icon by checking number of replies made on that topic

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-11 : 03:52:26
No Sir,
Yes i know about the number of topics and change of icon. But....

I am wondering how they got them made ?

sorry if the question wasnt put properly ? But i think its really cool.

Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2005-11-11 : 08:01:23
I have no idea how they made the icons. You'd do best to ask that question in the forums on the Snitz site.

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-11-11 : 16:19:07
Ok thanks Graz

Afrika
Go to Top of Page
   

- Advertisement -