yvi: Kaylee half-smiling, looking very pretty (Default)
yvi ([personal profile] yvi) wrote in [site community profile] dw_dev 2009-08-24 05:53 am (UTC)

[dw @ mark-dev - ~/current] -> grep -r " JOIN " cgi-bin | wc -l
3


Heh, yeah, I tried that, too. Found a few more, though, since there are some lowercase joins ;)

when you start doing tough queries like that, it's much hard to memcache the data, and writing (and figuring out/modifying later) the SQL is so hard.

Memcache, one of the last big misteries left on Earth ;)

If you select enough comments from the database you can be reasonably certain you're going to find a few posts.

Sounds good.

# try memcache first
my $recent = $u->memc_get( 'recently_commented_posts' );
return $make_entry_objs->( $recent ) if $recent;

...

$u->memc_set( 'recently_commented_posts', \@postids );


Ah, now I finally get how *that* works!

In our case, we know it won't be TOO terrible because we limit the number of comments on a single entry. So, at most, SELECT DISTINCT ... LIMIT 5 will go through 25,000 rows. Which is a lot, but is still much less than 'SELECT ... ORDER BY datepost' on some accounts.

*nods* So you think that would be fine? Limit 5 is good (I was planning on either 5 or 10). I'll take another look when it's not 7:30 and I am actually logged into my Dreamhack, but this sounds very reasonable. Thanks for the explanation!

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org