SELECT event.*
,
category.*,
user.*, user_profile.*, IF(user.username IS NULL, event.username, user.username) AS username
FROM xf_nflj_sportsbook_event AS event
LEFT JOIN xf_nflj_sportsbook_category AS category ON
(category.category_id = event.category_id)
LEFT JOIN xf_user AS user ON
(user.user_id = event.user_id)
LEFT JOIN xf_user_profile AS user_profile ON
(user_profile.user_id = event.user_id)
WHERE (event.category_id IN ('1')) AND (event.date_close < 1438727395) AND (event.event_status = 'open')
ORDER BY event.date_close ASC
LIMIT 5

Run Time: 0.001412

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

event

range

category_date_edit

category_date_edit

4

167

Using index condition; Using where; Using filesort

SIMPLE

category

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.event.category_id

1

SIMPLE

user

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.event.user_id

1

SIMPLE

user_profile

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.event.user_id

1

SELECT event.*
,
category.*,
user.*, user_profile.*, IF(user.username IS NULL, event.username, user.username) AS username
FROM xf_nflj_sportsbook_event AS event
LEFT JOIN xf_nflj_sportsbook_category AS category ON
(category.category_id = event.category_id)
LEFT JOIN xf_user AS user ON
(user.user_id = event.user_id)
LEFT JOIN xf_user_profile AS user_profile ON
(user_profile.user_id = event.user_id)
WHERE (event.category_id IN ('1')) AND (event.event_status IN ('open','closed'))
ORDER BY event.date_edit DESC
LIMIT 5

Run Time: 0.001110

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

event

range

category_date_edit

category_date_edit

4

167

Using where

SIMPLE

category

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.event.category_id

1

SIMPLE

user

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.event.user_id

1

SIMPLE

user_profile

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.event.user_id

1

SELECT event.*
,
category.*,
user.*, user_profile.*, IF(user.username IS NULL, event.username, user.username) AS username
FROM xf_nflj_sportsbook_event AS event
LEFT JOIN xf_nflj_sportsbook_category AS category ON
(category.category_id = event.category_id)
LEFT JOIN xf_user AS user ON
(user.user_id = event.user_id)
LEFT JOIN xf_user_profile AS user_profile ON
(user_profile.user_id = event.user_id)
WHERE (event.category_id IN ('1')) AND (event.event_status = 'open')
ORDER BY event.date_create DESC
LIMIT 5

SELECT ignore_thread.*, thread.*
,
NULL AS thread_read_date
FROM xf_ignore_thread AS ignore_thread
LEFT JOIN xf_thread AS thread ON (thread.thread_id = ignore_thread.thread_id)
WHERE ignore_thread.user_id = ?
ORDER BY ignore_thread.ignore_time DESC

Params: 0

Run Time: 0.000341

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

ignore_thread

ref

user_thread

user_thread

4

const

1

Using where; Using filesort

SIMPLE

thread

eq_ref

PRIMARY

PRIMARY

4

jfuqua_xenforo.ignore_thread.thread_id

1

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