[Theforum] [---Dev] RE: [---tent] Article cleanup issue

.jeff jeff at members.evolt.org
Wed Jul 24 04:36:13 CDT 2002


> From: John Handelaar
> > huh?  where am i loading those records in to an array?
> Sorry, I'm assuming that a script which receives 902
> rows as a result is processing them as an array once
> they get there.  My turn to go 'huh?' then :-)

i suppose technically a query object is a two dimensional array with columns in the first dimension and rows in the second.  accessing them in this fashion requires no extra work on my part though.

> > correct and should be changed.

actually, i was mistaken.  there is a column that stores the number of comments an article has.

> I guess that means that somewhere we have a display
> which says 'X comments, Y new' ?
> I vote ditch it then...

that won't be easy.  that was actually a requested feature that alot of people use, myself included.

> > > 4.  To get your total (if it's required, but that's
> > >     another story), I'd suggest a better approach
> > >     would be to run a second query a la MySQL's
> > >     SELECT COUNT(*) FROM stories, which is lightning
> > >     fast and returns only one row as a result.
> > ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> >
> > no offense, but yuck.  i'm willing to mess around with
> > the source code and see if  this shows measurable
> > improvement though.
> Again, in the follow-up to this I posted, I wanted to find
> out if we really are closing and re-opening connections as
> opposed to using pconnects...

we could post a gain by breaking up the homepage query in to a query for the first 10 results and another query for the total number of approved articles, but oracle has some wack approaches to limits.  i tried the approach of only showing the first 10, but oracle's implementation doesn't speed up the query at all because it still has to go get the entire resultset before processing the row limiting clause.

> Perhaps we could run that 'heavy' query as a server
> cron job every 10 mins to hide it from users?  If that,
> combined with an unbothered-attitude towards the
> (imho) unnecessary subdivision-by-login detail about
> what's new since last logon, then maybe this ruck of
> ours provides a solution within the day (yay!)...

removing the lastlogin criteria from the query doesn't solve anything.  you still need to cache (if that's the approach you want to take) a query for each category and the homepage.


jeff at members.evolt.org

More information about the theforum mailing list