SELECT COUNT(*)
FROM xf_thread AS thread
WHERE (thread.node_id = 92) AND (thread.sticky = 0) AND (thread.discussion_state IN ('visible'))

Run Time: 0.000217

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

thread

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_sticky_state_last_post

6

const,const,const

10

Using where; Using index

SELECT thread.*
,
user.*, IF(user.username IS NULL, thread.username, user.username) AS username,
NULL AS thread_read_date,
0 AS thread_is_watched,
0 AS user_post_count
FROM xf_thread AS thread
LEFT JOIN xf_user AS user ON
(user.user_id = thread.user_id)
WHERE (thread.node_id = 92) AND (thread.sticky = 0) AND (thread.discussion_state IN ('visible'))
ORDER BY thread.last_post_date DESC
LIMIT 20

Run Time: 0.002506

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

thread

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_sticky_state_last_post

6

const,const,const

10

Using where

SIMPLE

user

eq_ref

PRIMARY

PRIMARY

4

admin_forum.thread.user_id

1

SELECT thread.*
,
user.*, IF(user.username IS NULL, thread.username, user.username) AS username,
NULL AS thread_read_date,
0 AS thread_is_watched,
0 AS user_post_count
FROM xf_thread AS thread
LEFT JOIN xf_user AS user ON
(user.user_id = thread.user_id)
WHERE (thread.node_id = 92) AND (thread.sticky = 1) AND (thread.discussion_state IN ('visible'))
ORDER BY thread.last_post_date DESC

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

Params: 114

Run Time: 0.000322

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

th

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_last_post_date

4

const

12

Using temporary; Using filesort

SIMPLE

po

ref

thread_id_post_date,thread_id_position

thread_id_position

4

admin_forum.th.thread_id

6

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

Params: 116

Run Time: 0.000241

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

th

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_last_post_date

4

const

35

Using temporary; Using filesort

SIMPLE

po

ref

thread_id_post_date,thread_id_position

thread_id_position

4

admin_forum.th.thread_id

6

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

Params: 115

Run Time: 0.000286

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

th

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_last_post_date

4

const

10

Using temporary; Using filesort

SIMPLE

po

ref

thread_id_post_date,thread_id_position

thread_id_position

4

admin_forum.th.thread_id

6

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

Params: 114

Run Time: 0.000373

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

th

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_last_post_date

4

const

12

Using temporary; Using filesort

SIMPLE

po

ref

thread_id_post_date,thread_id_position

thread_id_position

4

admin_forum.th.thread_id

6

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

Params: 116

Run Time: 0.000311

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

th

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_last_post_date

4

const

35

Using temporary; Using filesort

SIMPLE

po

ref

thread_id_post_date,thread_id_position

thread_id_position

4

admin_forum.th.thread_id

6

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1

Params: 115

Run Time: 0.000332

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

th

ref

node_id_last_post_date,node_id_sticky_state_last_post

node_id_last_post_date

4

const

10

Using temporary; Using filesort

SIMPLE

po

ref

thread_id_post_date,thread_id_position

thread_id_position

4

admin_forum.th.thread_id

6

SELECT
th.title as th_title,
po.message as th_message,
po.username as th_user,
po.user_id as th_user_id,
FROM_UNIXTIME(th.last_post_date) as th_date
FROM xf_thread as th
LEFT JOIN xf_post as po
ON po.thread_id = th.thread_id
WHERE th.node_id = ?
ORDER BY po.post_date DESC
LIMIT 1