php - How to optimize this query which taking long time.? -


When working with the following query on mysql, it is executed around 10sec.

  SELECT photo_image_uploaded, b.bottle_id, b.date, b.parentid as SQL_CALC_FOUND_ROWS DISTINCT b.appearance_id, b.photo_album_id, b.eventcmmnt_id, b.id, b.mem_id, b.subj , B.body, b.image_link, b. The from_id, b.visible_to, pa.photo_big image_link, b.post_via, b.youtubeLink, b.link_image, b.link_url, b.auto_genrate_text, badges.badge_img, badges.badge_bottle_img, Bulletin of b.type, b b.share_url_title as members of the INNER network N on (n.mem_id = b.mem_id) Join left Join badge on (Bikbotl_aidi = Bajkbaj_aidi) left Join as photo_album pa (pa.photo_id = b.photo_album_id) Join mem on (b.mem_id = mem.mem_id and mem.deleted & lt; & gt; 'Y') where b.parentid = '0' and ( '$ userid' (n .frd_id, b.mem_id, B.from_id) by b.id command in b.id DESC LIMIT within the barrier of 0,10  

in the group There are many frd_id, mem_id, from_id so I think the above queries are slowly executing ... so please help optimize the question above

Check that your fields are indexed, which is used to connect.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -