Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 01-28-2005, 08:21 PM   PM User | #1
Sensei Eggwoah
New to the CF scene

 
Join Date: Jan 2005
Location: PA, USA
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Sensei Eggwoah is an unknown quantity at this point
Is using large select queries a bad practice (Solved)

First off, I want to say 'ello to all of you. (I'm new)

I have been programming a limited bbs system in php, and I was curious as to how I should approach some of the queries. For example, when I do post counts, should I run a query to count how many posts match the member's id, or will that eventually become slow when alot of topics become posted? I thought that maybe I could just simply update a post count value in the members table and use that. Also on the main page I have it count the number of total posts, and displaying the total number of topics as well as replies. Is this a bad thing? I somehow doubt that if I actually use these scripts, that my bbs will become large, but there is always a chance...

Sorry, I'm semi-new to this stuff. Thanks to anyone who can lend me a hand

Last edited by Sensei Eggwoah; 01-28-2005 at 10:39 PM.. Reason: solved
Sensei Eggwoah is offline   Reply With Quote
Old 01-28-2005, 10:02 PM   PM User | #2
Kiwi
Regular Coder

 
Join Date: Oct 2002
Posts: 379
Thanks: 0
Thanked 0 Times in 0 Posts
Kiwi is an unknown quantity at this point
A count query on an indexed field is usually very fast and you're returning a small result set, so it's nothing to worry about. You would need a lot of data to start taking a noticable performance hit - in the order of millions. By that time, you will have other performance issues and should be looking at archiving old data.
__________________
Strategy Conscious
Kiwi is offline   Reply With Quote
Old 01-28-2005, 10:11 PM   PM User | #3
Sensei Eggwoah
New to the CF scene

 
Join Date: Jan 2005
Location: PA, USA
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Sensei Eggwoah is an unknown quantity at this point
Thanks a ton Kiwi! I wanted to make sure that I didn't shoot myself in the foot with my code.
Sensei Eggwoah is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:21 PM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.