ginatrapani/ThinkUp — pull request #1811 by cdmoyer (2014-02-05 03:00:41+00:00)
Title: Added test for countCheckinsToPlaceTypesLastWeek

Renamed the test for countCheckinsToPlaceTypesLastWeek
that actually tested countCheckinsToPlaceTypes.

This is in reference to slow queries reported on the mailing list, generated by that function:

```
From: Noah Mittman noah@teradome.com
This is what my ISP just wrote to me:

Hi - I'm seeing this fairly consistently in my slow-query reports:

SELECT place_type, COUNT(place_type) AS place_count FROM tu_places WHERE
place_id IN (SELECT place_id FROM tu_posts WHERE author_user_id='3439' AND
network='foursquare' AND YEARWEEK(pub_date) = YEARWEEK(CURRENT_DATE) AND
in_reply_to_post_id IS null ) GROUP BY place_type;

In particular, you'll want to use the 'explain' feature in MySQL so that
you get a better plan. Currently it uses a where/temp/filesort, and
ideally you want it to be using at most a 'where' with some indexes.

Probably rewriting it as a join will make a big improvement.
```