SELECT
P.post_id, P.blog_id, P.user_id, P.cat_id, post_dt, post_tz,
post_creadt, post_upddt, post_format, post_password, post_url,
post_lang, post_title, post_excerpt, post_excerpt_xhtml, post_content,
post_content_xhtml, post_notes, post_type, post_meta, post_status,
post_selected, post_position, post_open_comment, post_open_tb,
nb_comment, nb_trackback, U.user_name, U.user_firstname,
U.user_displayname, U.user_email, U.user_url, C.cat_title, C.cat_url,
C.cat_desc FROM dc_post P INNER JOIN dc_user U ON U.user_id = P.user_id
LEFT OUTER JOIN dc_category C ON P.cat_id = C.cat_id WHERE P.blog_id =
'open-time' AND ((post_status = 1 AND post_password IS NULL ) ) AND
post_type IN ('post') AND ( (post_dt = '2004-10-12 10:33:29' AND
P.post_id > 2795) OR post_dt > '2004-10-12 10:33:29' ) ORDER
BY post_dt ASC, P.post_id ASC LIMIT 1;
Sur mon blog ça donne ça :
# Query_time: 2.021316 Lock_time: 0.000466 Rows_sent: 1 Rows_examined: 12730
Pour résumer le nombre de lignes parcourues est assez volumineux.
Comment peut-on optimiser ce genre de requête ?
Vous avez jusque début janvier et d'ici là passez de bonnes fêtes !
Franck