Front page wonky


log in or register to remove this ad

resistor said:
That just seems like an awfully inefficient way to implement the recent posts thing. I feel like there's got to be some better way to do it.

As an idea, I would suggest looking into using stored procedures (also called triggers) to fetch the most recent posts. Basically, these allow complicated queries (like finding the most recent posts across all forums) to be written in scripts within the database server. This would likely be a speed gain, since it removes the need to transmit large intermediate datasets (all the posts on the forums) from the server to the client. Rather, the server only transmits the final product of the procedure.

I'd be willing to help figure out how to do it, but I'm not familiar with the database model ENWorld uses.
Hmm, when I read the original post, I assumed that what Twin Rose was describing was what the SQL was doing, not what the page was doing. However, I have seen java developers write some very strange code before! The correct way would be to open a SQL cursor of the SELECT statement with an ORDER BY clause and read the first n records, then close the cursor. If, however, the code is issuing SQL to read the whole data set, then doing the sort programatically, then it looks like resistor has just spotted a BIG bit of bad coding that you should be able to correct.

Cheers,
Liam

P.S. this doesn't need to be written in a stored procedure in order to restrict the size of the results set being transferred back to the client - correct use of a cursor (as I've described) will achieve this.
 
Last edited:

I have no idea to what extent the page's code constructs raw SQL queries, and to what extent it uses a DBA API built into PHP. If it's the latter, it's entirely possible that PHP is doing something stupid like transferring the large datasets back to the client at each step.

As to stored procedures, I admit to having an ulterior motive in suggesting them: since the site seems to have recently been targetted for security holes that allows its use as a spam relay. As such, I think a shift in focus to securing the site might be appropriate, and I'm of the school of thought that stored procedures generally lead to more securely written sites. But yes, proper cursor use would work too. ;)

At any rate, I do think their ought to be some way to optimize the lookup process for recent posts.
 

I just had to pop in to say that I'm quite happy with the functionality of the site; it's better than any other forum I belong to. I have a CS account for just that purpose - to support the site.

I also have to say that thanks to the job I started back in April I can now actually understand what nerfherder and resistor are talking about!! :eek: :D

Now if I could just get rid of Internet Explorer as my browser here at work, all would be hunky-dory with my ENworld enjoyment. Stupid IE. :mad:
 
Last edited:

resistor said:
That just seems like an awfully inefficient way to implement the recent posts thing. I feel like there's got to be some better way to do it.

As an idea, I would suggest looking into using stored procedures (also called triggers) to fetch the most recent posts. Basically, these allow complicated queries (like finding the most recent posts across all forums) to be written in scripts within the database server. This would likely be a speed gain, since it removes the need to transmit large intermediate datasets (all the posts on the forums) from the server to the client. Rather, the server only transmits the final product of the procedure.

I'd be willing to help figure out how to do it, but I'm not familiar with the database model ENWorld uses.

I believe it's partially inefficient because of checks for things like whether or not you have ACCESS to each given forum before showing the thread, so it's a ton of joins, rather than strictly just looking at the date.
 

Twin Rose said:
I believe it's partially inefficient because of checks for things like whether or not you have ACCESS to each given forum before showing the thread, so it's a ton of joins, rather than strictly just looking at the date.

Wow. If that means what I think it does, then that's just...stupid.

Or it doesn't mean that, in which case, nevermind.

Still no frelling big ad on the front page. Still happy.
Nell.
 

Nellisir said:
Wow. If that means what I think it does, then that's just...stupid.

Or it doesn't mean that, in which case, nevermind.

Still no frelling big ad on the front page. Still happy.
Nell.

I talked with Morrus about the ad, and it may be gone for good - the side ad there for the mini's looks way better. For the advertisers, the leaderboard ad (I think?) didn't generate particularly more hits than banners, and certainly it is nice for people using the front page. But, I can't speak for him, just looks that way at this point :)
 

What about at the least a link on the main page leading to the recent reviews where the recent reviews where. Sure its in the table of contents but when you're dealing with the basic sufer when they see something missing they think its gone, and won't look elsewhere.

I must admit, I think the decision to take them off the front page will hurt somewhat the flow of traffic to the site. There's the person whom surfaces enworld and then the person who just scans it and sees whats popping. This move alienates the second group.
 

A. You get that a lot... :p

B. No Comment.

C. Well, one think you do need to keep in mind.
None of us, will ever, never speak or think for Morrus.

And going back to A. BK, a little advice...think well before you write.


Peace.
BrooklynKnight said:
You know, in further retrospect, my venom was due to a number of contributing factors.

A. My cranky mood.

B. Wystans annoying persitence

C. I think I was trying to say what Morrus couldnt, or wouldnt. He's got far too much tact to speak to members of the site that way. I'm not saying I was speaking for him, mearly that If i was him thats how id react.

In any case the moment is past.
 
Last edited:

JB (forgive the pun) at that time, him and seven others were given accounts by me. It was a random pick.

Being 'convinced' had nothing to do it.
JoeBlank said:
Well, I guess someone was convinced that you were a valuable contributor to the site and deserved a membership. And then you agreed, and thought you should stay a member.
 

Remove ads

Top