AJAX на форуме

#1 6 августа 2012 в 21:03
Форум тормозит страшно и я так понимаю из за того что много статей и тем соответствующих
Может можно как то аякс прикрутить к нему?
#2 6 августа 2012 в 21:34
на одном сайте вроде не много тем, но главная форумов тормозит жестко) думаю что сам че-то перехимичил)
Здесь ведь форум не тормозит!) и тем здесь не мало!)
#3 6 августа 2012 в 22:51
вот и у меня главная 10 секунд открывается smile
#4 7 августа 2012 в 11:30

вот и у меня главная 10 секунд открывается

eoleg
инстант какой версии? Если 1.7, то там беда. Индексов нет. И даже если 1.8, или 1.9, обновленная с 1.7 тоже беда, индексы при обновлении не появляются.

Если с новой версией, то хз. У меня форум сп, сообщений тыщ 70-80, тем куча. Полет нормальный :)
#5 7 августа 2012 в 11:46
SQL запрос улучшает ситуацию:
  1.  
  2. ALTER TABLE `cms_forums` ADD INDEX ( `category_id` );
  3. ALTER TABLE `cms_forum_threads` ADD INDEX ( `forum_id` );
  4. ALTER TABLE `cms_forum_posts` ADD INDEX ( `thread_id` );
  5. ALTER TABLE `cms_forum_files` ADD INDEX ( `post_id` );
  6. ALTER TABLE `cms_forum_polls` ADD INDEX ( `thread_id` );
  7. ALTER TABLE `cms_forum_votes` ADD INDEX ( `poll_id` );
  8.  
#6 7 августа 2012 в 16:59
А как вообще посмотреть что тормозит, ну то есть увидеть какой то запрос или часть программы какая то?
может можно какую то директиву указать и она выведет на экран в лог сообщение что эта инструкция выполнялась столько то.

Время генерации страницы: 21.5911 сек.
Запросы к базе: 445
столько запросов это нормально?
#7 8 августа 2012 в 10:01
Даже 50 запросов — это не нормально. Нужно посмотреть что за запросы и выяснить откуда они берутся.
#8 8 августа 2012 в 10:54

Время генерации страницы: 21.4006 сек.
Запросы к базе: 439

SET NAMES cp1251

SELECT * FROM cms_menu ORDER BY id ASC

SELECT id, title, link, config, internal, published, version, system FROM cms_components

SELECT p.id, p.plugin, p.config, e.event FROM cms_plugins p, cms_event_hooks e WHERE p.published = 1 AND e.plugin_id = p.id

SELECT u.*, g.is_admin is_admin, p.imageurl as imageurl
FROM cms_users u
INNER JOIN cms_user_groups g ON g.id = u.group_id
INNER JOIN cms_user_profiles p ON p.user_id = u.id
WHERE u.id='1' AND u.is_deleted = 0 AND u.is_locked = 0 LIMIT 1

SELECT 1 FROM cms_banlist WHERE ip = '1.1.1.1' AND status=1

DELETE FROM cms_online WHERE lastdate <= DATE_SUB(NOW(), INTERVAL 3 MINUTE)

SELECT id as getfield FROM cms_online WHERE sess_id = '442bbe54f9b9b73b090e10a015a0c02a' AND ip = '1.1.1.1' LIMIT 1

UPDATE cms_online
SET lastdate = NOW(),
user_id = '1',
viewurl = '/forum'
WHERE (sess_id = '442bbe54f9b9b73b090e10a015a0c02a' AND ip = '1.1.1.1')

SELECT NSLeft, NSRight FROM cms_menu WHERE id = '18'

SELECT id, title, link, linktype
FROM cms_menu
WHERE NSLeft <= 20 AND NSRight >= 21 AND parent_id > 0
ORDER BY NSLeft

SELECT *
FROM cms_forum_cats
WHERE published = 1
ORDER BY ordering

SELECT id as getfield FROM cms_forums WHERE parent_id=0 LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '1' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 2 AND NSRight < 7 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '2' AND f.NSRight <= '7' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '2' AND f.NSRight <= '7' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 2 AND f.NSRight <= 7)
ORDER BY p.id DESC
LIMIT 1

SELECT 1 FROM cms_forum_posts WHERE thread_id=17232

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '2' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 12 AND NSRight < 13 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '12' AND f.NSRight <= '13' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '12' AND f.NSRight <= '13' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1009' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 12 AND f.NSRight <= 13)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 14 AND NSRight < 15 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '14' AND f.NSRight <= '15' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '14' AND f.NSRight <= '15' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1010' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 14 AND f.NSRight <= 15)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 24 AND NSRight < 25 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '24' AND f.NSRight <= '25' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '24' AND f.NSRight <= '25' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1016' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 24 AND f.NSRight <= 25)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '3' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 16 AND NSRight < 17 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '16' AND f.NSRight <= '17' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '16' AND f.NSRight <= '17' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1012' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 16 AND f.NSRight <= 17)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 18 AND NSRight < 19 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '18' AND f.NSRight <= '19' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '18' AND f.NSRight <= '19' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1013' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 18 AND f.NSRight <= 19)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 20 AND NSRight < 21 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '20' AND f.NSRight <= '21' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '20' AND f.NSRight <= '21' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1014' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 20 AND f.NSRight <= 21)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 22 AND NSRight < 23 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '22' AND f.NSRight <= '23' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '22' AND f.NSRight <= '23' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1015' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 22 AND f.NSRight <= 23)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 26 AND NSRight < 27 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '26' AND f.NSRight <= '27' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '26' AND f.NSRight <= '27' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1017' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 26 AND f.NSRight <= 27)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 28 AND NSRight < 29 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '28' AND f.NSRight <= '29' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '28' AND f.NSRight <= '29' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1018' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 28 AND f.NSRight <= 29)
ORDER BY p.id DESC
LIMIT 1

SELECT 1 FROM cms_forum_posts WHERE thread_id=3185

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 30 AND NSRight < 31 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '30' AND f.NSRight <= '31' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '30' AND f.NSRight <= '31' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1019' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 30 AND f.NSRight <= 31)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 32 AND NSRight < 33 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '32' AND f.NSRight <= '33' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '32' AND f.NSRight <= '33' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1020' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 32 AND f.NSRight <= 33)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 34 AND NSRight < 35 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '34' AND f.NSRight <= '35' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '34' AND f.NSRight <= '35' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1021' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 34 AND f.NSRight <= 35)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 36 AND NSRight < 37 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '36' AND f.NSRight <= '37' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '36' AND f.NSRight <= '37' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1011' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 36 AND f.NSRight <= 37)
ORDER BY p.id DESC
LIMIT 1

SELECT 1 FROM cms_forum_posts WHERE thread_id=15580

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '7' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 38 AND NSRight < 39 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '38' AND f.NSRight <= '39' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '38' AND f.NSRight <= '39' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1022' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 38 AND f.NSRight <= 39)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 40 AND NSRight < 41 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '40' AND f.NSRight <= '41' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '40' AND f.NSRight <= '41' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1023' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 40 AND f.NSRight <= 41)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 42 AND NSRight < 43 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '42' AND f.NSRight <= '43' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '42' AND f.NSRight <= '43' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1024' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 42 AND f.NSRight <= 43)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 44 AND NSRight < 45 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '44' AND f.NSRight <= '45' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '44' AND f.NSRight <= '45' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1025' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 44 AND f.NSRight <= 45)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 46 AND NSRight < 47 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '46' AND f.NSRight <= '47' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '46' AND f.NSRight <= '47' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1026' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 46 AND f.NSRight <= 47)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 48 AND NSRight < 49 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '48' AND f.NSRight <= '49' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '48' AND f.NSRight <= '49' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1027' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 48 AND f.NSRight <= 49)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 50 AND NSRight < 51 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '50' AND f.NSRight <= '51' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '50' AND f.NSRight <= '51' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1028' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 50 AND f.NSRight <= 51)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '5' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 52 AND NSRight < 53 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '52' AND f.NSRight <= '53' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '52' AND f.NSRight <= '53' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1029' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 52 AND f.NSRight <= 53)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 54 AND NSRight < 55 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '54' AND f.NSRight <= '55' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '54' AND f.NSRight <= '55' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1030' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 54 AND f.NSRight <= 55)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 56 AND NSRight < 57 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '56' AND f.NSRight <= '57' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '56' AND f.NSRight <= '57' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1031' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 56 AND f.NSRight <= 57)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 58 AND NSRight < 59 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '58' AND f.NSRight <= '59' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '58' AND f.NSRight <= '59' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1032' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 58 AND f.NSRight <= 59)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 100 AND NSRight < 101 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '100' AND f.NSRight <= '101' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '100' AND f.NSRight <= '101' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1053' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 100 AND f.NSRight <= 101)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 102 AND NSRight < 103 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '102' AND f.NSRight <= '103' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '102' AND f.NSRight <= '103' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1054' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 102 AND f.NSRight <= 103)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '6' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 60 AND NSRight < 61 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '60' AND f.NSRight <= '61' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '60' AND f.NSRight <= '61' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1033' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 60 AND f.NSRight <= 61)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 62 AND NSRight < 63 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '62' AND f.NSRight <= '63' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '62' AND f.NSRight <= '63' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1034' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 62 AND f.NSRight <= 63)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 64 AND NSRight < 65 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '64' AND f.NSRight <= '65' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '64' AND f.NSRight <= '65' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1035' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 64 AND f.NSRight <= 65)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 66 AND NSRight < 67 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '66' AND f.NSRight <= '67' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '66' AND f.NSRight <= '67' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1036' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 66 AND f.NSRight <= 67)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 68 AND NSRight < 69 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '68' AND f.NSRight <= '69' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '68' AND f.NSRight <= '69' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1037' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 68 AND f.NSRight <= 69)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 70 AND NSRight < 71 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '70' AND f.NSRight <= '71' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '70' AND f.NSRight <= '71' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1038' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 70 AND f.NSRight <= 71)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 72 AND NSRight < 73 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '72' AND f.NSRight <= '73' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '72' AND f.NSRight <= '73' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1039' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 72 AND f.NSRight <= 73)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 74 AND NSRight < 75 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '74' AND f.NSRight <= '75' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '74' AND f.NSRight <= '75' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1040' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 74 AND f.NSRight <= 75)
ORDER BY p.id DESC
LIMIT 1

SELECT 1 FROM cms_forum_posts WHERE thread_id=9818

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '4' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 84 AND NSRight < 85 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '84' AND f.NSRight <= '85' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '84' AND f.NSRight <= '85' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1045' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 84 AND f.NSRight <= 85)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 86 AND NSRight < 87 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '86' AND f.NSRight <= '87' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '86' AND f.NSRight <= '87' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1046' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 86 AND f.NSRight <= 87)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 88 AND NSRight < 89 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '88' AND f.NSRight <= '89' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '88' AND f.NSRight <= '89' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1047' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 88 AND f.NSRight <= 89)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '10' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 76 AND NSRight < 77 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '76' AND f.NSRight <= '77' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '76' AND f.NSRight <= '77' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1041' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 76 AND f.NSRight <= 77)
ORDER BY p.id DESC
LIMIT 1

SELECT 1 FROM cms_forum_posts WHERE thread_id=2519

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 78 AND NSRight < 79 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '78' AND f.NSRight <= '79' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '78' AND f.NSRight <= '79' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1042' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 78 AND f.NSRight <= 79)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 80 AND NSRight < 81 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '80' AND f.NSRight <= '81' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '80' AND f.NSRight <= '81' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1043' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 80 AND f.NSRight <= 81)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 82 AND NSRight < 83 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '82' AND f.NSRight <= '83' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '82' AND f.NSRight <= '83' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1044' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 82 AND f.NSRight <= 83)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '13' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 90 AND NSRight < 91 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '90' AND f.NSRight <= '91' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '90' AND f.NSRight <= '91' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1048' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 90 AND f.NSRight <= 91)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 92 AND NSRight < 93 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '92' AND f.NSRight <= '93' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '92' AND f.NSRight <= '93' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1049' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 92 AND f.NSRight <= 93)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 94 AND NSRight < 95 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '94' AND f.NSRight <= '95' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '94' AND f.NSRight <= '95' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1050' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 94 AND f.NSRight <= 95)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 96 AND NSRight < 97 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '96' AND f.NSRight <= '97' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '96' AND f.NSRight <= '97' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1051' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 96 AND f.NSRight <= 97)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 98 AND NSRight < 99 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '98' AND f.NSRight <= '99' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '98' AND f.NSRight <= '99' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1052' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 98 AND f.NSRight <= 99)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '8' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 104 AND NSRight < 105 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '104' AND f.NSRight <= '105' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '104' AND f.NSRight <= '105' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1055' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 104 AND f.NSRight <= 105)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 106 AND NSRight < 107 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '106' AND f.NSRight <= '107' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '106' AND f.NSRight <= '107' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1056' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 106 AND f.NSRight <= 107)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 108 AND NSRight < 109 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '108' AND f.NSRight <= '109' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '108' AND f.NSRight <= '109' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1057' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 108 AND f.NSRight <= 109)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 110 AND NSRight < 111 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '110' AND f.NSRight <= '111' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '110' AND f.NSRight <= '111' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1058' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 110 AND f.NSRight <= 111)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 112 AND NSRight < 113 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '112' AND f.NSRight <= '113' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '112' AND f.NSRight <= '113' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1059' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 112 AND f.NSRight <= 113)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 114 AND NSRight < 115 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '114' AND f.NSRight <= '115' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '114' AND f.NSRight <= '115' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1060' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 114 AND f.NSRight <= 115)
ORDER BY p.id DESC
LIMIT 1

SELECT *
FROM cms_forums
WHERE published = 1 AND category_id = '12' AND parent_id = '1000'
ORDER BY ordering

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 116 AND NSRight < 117 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '116' AND f.NSRight <= '117' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '116' AND f.NSRight <= '117' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1061' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 116 AND f.NSRight <= 117)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 118 AND NSRight < 119 AND parent_id > 0
ORDER BY title

SELECT t.id
FROM cms_forum_threads t
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '118' AND f.NSRight <= '119' AND f.published = 1

SELECT p.id
FROM cms_forum_posts p
INNER JOIN cms_forum_threads t ON t.id = p.thread_id
INNER JOIN cms_forums f ON f.id = t.forum_id AND f.NSLeft >= '118' AND f.NSRight <= '119' AND f.published = 1

SELECT NSLeft, NSRight FROM cms_forums WHERE id='1062' ORDER BY id ASC LIMIT 1

SELECT p.pubdate, p.id as post_id,
u.id as uid, u.nickname as author,
u.login as author_login,
t.title as threadtitle, t.id as threadid
FROM cms_forum_posts p
LEFT JOIN cms_forum_threads t ON t.id = p.thread_id AND t.is_hidden=0
INNER JOIN cms_forums f ON f.id = t.forum_id
LEFT JOIN cms_users u ON u.id = p.user_id
WHERE (f.NSLeft >= 118 AND f.NSRight <= 119)
ORDER BY p.id DESC
LIMIT 1

SELECT id, title, access_list
FROM cms_forums
WHERE NSLeft > 120 AND NSRight < 121 AND parent_id > 0
ORDER BY title

SE
#9 8 августа 2012 в 11:17
У меня:
Время генерации страницы: 0.2886 сек.
Запросы к базе: 130

Количество запросов можно уменьшить, но 22 секунды — это слишком уж много...

eoleg, у вас там нет модуля последних комментариев случаем? Ибо он до 8 секунд у меня выполнял запрос…
#10 8 августа 2012 в 11:43

нет модуля последних комментариев

lokanaft
нету
а может можно как то вставить в код какие то директивы с выводом в лог чтобы посмотреть код на котором так тормозит
ну типа процедура ххх — 1 сек, процедура yyy — 5 сек ....

в мyadmine все таблицы открываются с задержкой максимум 0,0003 сек
#11 8 августа 2012 в 12:17
/core/classes/db.class.php — function query :
  1. public function query($sql, $ignore_errors=false){
  2. $inConf = cmsConfig::getInstance();
  3. $sql = $this->replacePrefix($sql);
  4. if ($inConf->debug){
  5. $mtime = microtime();
  6. $mtime = explode(" ",$mtime);
  7. $mtime = $mtime[1] + $mtime[0];
  8. $tstart = $mtime;
  9. }
  10. $result = mysql_query($sql, $this->db_link);
  11. if ($inConf->debug){
  12. $mtime = microtime();
  13. $mtime = explode(" ",$mtime);
  14. $mtime = $mtime[1] + $mtime[0];
  15. $tend = $mtime;
  16. $tpassed = ($tend - $tstart);
  17. }
  18. if ($inConf->debug){
  19. $this->q_count += 1;
  20. $this->q_dump .= '<pre>'.$sql.' <b style="color:'.($tpassed<0.1 ? 'green' : 'red').';">'.$tpassed.' сек.</b></pre><hr/>';
  21. }
  22.  
  23. if (mysql_error() && $inConf->debug && !$ignore_errors){
  24. die('<div style="margin:2px;border:solid 1px gray;padding:10px">DATABASE ERROR: <pre>'.$sql.'</pre>'.mysql_error().'</div>');
  25. }
  26.  
  27. return $result;
  28. }
Измените функцию и найдёте медленные запросы.
#12 8 августа 2012 в 12:40
Время генерации страницы: 0.1997 сек.
Запросы к базе: 257
#13 8 августа 2012 в 13:02


/core/classes/db.class.php — function query :

  1. public function query($sql, $ignore_errors=false){
  2. $inConf = cmsConfig::getInstance();
  3. $sql = $this->replacePrefix($sql);
  4. if ($inConf->debug){
  5. $mtime = microtime();
  6. $mtime = explode(" ",$mtime);
  7. $mtime = $mtime[1] + $mtime[0];
  8. $tstart = $mtime;
  9. }
  10. $result = mysql_query($sql, $this->db_link);
  11. if ($inConf->debug){
  12. $mtime = microtime();
  13. $mtime = explode(" ",$mtime);
  14. $mtime = $mtime[1] + $mtime[0];
  15. $tend = $mtime;
  16. $tpassed = ($tend - $tstart);
  17. }
  18. if ($inConf->debug){
  19. $this->q_count += 1;
  20. $this->q_dump .= ''.$sql.' '.$tpassed.' сек.';
  21. }
  22.  
  23. if (mysql_error() && $inConf->debug && !$ignore_errors){
  24. die('DATABASE ERROR: '.$sql.''.mysql_error().'');
  25. }
  26.  
  27. return $result;
  28. }
Измените функцию и найдёте медленные запросы.

lokanaft

Или арендовать VDS сервер и включить лог медленных запросов!
#14 8 августа 2012 в 16:36

Измените функцию и найдёте медленные запросы.

lokanaft
+
спасибо, вижу время выполнения
#15 8 августа 2012 в 16:58
SELECT NSLeft, NSRight FROM cms_forums WHERE id='1041' ORDER BY id ASC LIMIT 1 9.98973846436E-5 сек.
а это что такое — 9.99 секунд или что?
Вы не можете отвечать в этой теме.
Войдите или зарегистрируйтесь, чтобы писать на форуме.
Используя этот сайт, вы соглашаетесь с тем, что мы используем файлы cookie.