[thesite] t.e.o. updates

.jeff jeff at members.evolt.org
Sat Nov 17 14:33:22 CST 2001


rudy (and dean),

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: .jeff
>
> yeah.  tried that [...]
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

nevermind, i got it working.  i just had to reload the page.

    SELECT content.contentid
         , content.keyphrase
         , content.contentname
         , content.synopsis
         , content.datemod
         , content.replies
         , content.rating
         , content.ratings
         , users.userid
         , users.who
         , categorys.category
         , categorys.categoryid
         , rand.random AS rank
      FROM content
         , users
         , categorys
     WHERE categorys.categoryid = content.categoryid
       AND content.userid = users.userid
       AND content.signoff = 1
       AND content.categoryid NOT IN (1, 23, 26, 9741)
       AND content.datemod < '#DateFormat(DateAdd("yyyy" , -1, Now()))#'
     ORDER BY rank

dean, any thoughts on why that error occurred to begin with?

(btw, props to joshua for turning me on to this solution -- one query baby,
OH YEAH)

although double-checking execution times, i'm not sure i like the penalty of
reducing it to a single query.  this single query takes an average of
500-600ms to execute.  these two queries reliably execute in sub 40ms (with
the advantage that the first one is cachable).

    SELECT contentid
      FROM content
     WHERE signoff = 1
       AND categoryid NOT IN (1, 23, 26, 9741)
       AND datemod < '#DateFormat(DateAdd("yyyy" , -1, Now()))#'

    SELECT content.contentid
         , content.keyphrase
         , content.contentname
         , content.synopsis
         , content.datemod
         , content.replies
         , content.rating
         , content.ratings
         , users.userid
         , users.who
         , categorys.category
         , categorys.categoryid
      FROM content
         , users
         , categorys
     WHERE categorys.categoryid = content.categoryid
       AND content.userid = users.userid
       AND content.signoff = 1
       AND content.categoryid NOT IN (1, 23, 26, 9741)
       AND content.contentid = #Val(getrevivedrange.contentid[RandRange(1,
getrevivedrange.recordcount)])#

based on the time differences, i think i'll stick with the two query
approach.

thanks,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thesite mailing list