wordpress support stick publish function. and keep stick info in wp_options table named sticky_posts and can autoload.

and so i search in to the sql produced by wordpress, (add log = /tmp/mysql.log during my.cnf). open the index page of wordpress. sticky posts shows normally. however when I take a look at sql, found all wordpress_posts related sql, there's no stick ids used. just how wordpress implemented the stick ?

all wordpress_posts related queries:

      130 Query SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')  ORDER BY wp_posts.post_date DESC LIMIT 0, 3


      130 Query SELECT * FROM wp_posts  WHERE (post_type = 'page' AND post_status = 'publish')     ORDER BY menu_order, post_title ASC


      130 Query SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 0, 5


      130 Query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts  WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC

How to sticky a post in Wordpress