I'm trying to retrieve all of the photos that a user is tagged in from Facebook. I have both the user_photos and friends_photos access token but am not getting a full list of photos (i.e. all the photos the user is tagged in).
Below is my fql query:
SELECT images, target_type FROM photo WHERE pid IN (SELECT pid FROM photo_tag WHERE subject =" + req.user.id + ")ORDER BY created DESC
I'm rather confused as some of the photos that are not being retrieved have been uploaded publicly. Basically I am unable to see a pattern among the photos that haven been left out. Could anyone explain why some photos are being left out?
The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `photo` ADD INDEX `photo_idx_created` (`created`); ALTER TABLE `photo_tag` ADD INDEX `photo_tag_idx_subject_id_+__pid` (`subject`,`id + `,`pid`);
SELECT photo.images, photo.target_type FROM photo WHERE EXISTS ( SELECT 1 FROM photo_tag WHERE ( photo_tag.subject = photo_tag." + req.user.id + " ) AND ( photo.pid = photo_tag.pid ) ) ORDER BY photo.created DESC