{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf270 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\fs24 \cf0 EXPLAIN results:\ \ (1)\ mysql> explain select page0_.CONTENTID as CONTENTID, page0_.CHILD_POSITION as CHILD_P13_, page0_.PARENTID\ as PARENTID, page0_.SPACEID as SPACEID, page0_.TITLE as TITLE, page0_.VERSION as VERSION,\ page0_.CREATOR as CREATOR, page0_.CREATIONDATE as CREATION6_, page0_.LASTMODIFIER as\ LASTMODI7_, page0_.LASTMODDATE as LASTMODD8_, page0_.VERSIONCOMMENT as VERSIONC9_,\ page0_.PREVVER as PREVVER, page0_.CONTENT_STATUS as CONTENT11_ from CONTENT page0_, SPACES\ space1_ where page0_.CONTENTTYPE='XXXX' and ((lower(space1_.SPACEKEY)='XXXX' and\ page0_.SPACEID=space1_.SPACEID)and(lower(page0_.TITLE)='XXXX' )and(page0_.PREVVER XXXX\ )and(page0_.CONTENT_STATUS='XXXX' ));\ +----+-------------+---------+--------+-----------------------------------------------+---------------+---------+----------------------+-------+-------------+\ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |\ +----+-------------+---------+--------+-----------------------------------------------+---------------+---------+----------------------+-------+-------------+\ | 1 | SIMPLE | page0_ | ref | c_spaceid_idx,c_prevver_idx,c_contenttype_idx | c_prevver_idx | 9 | const | 48624 | Using where | \ | 1 | SIMPLE | space1_ | eq_ref | PRIMARY | PRIMARY | 8 | wikis.page0_.SPACEID | 1 | Using where | \ +----+-------------+---------+--------+-----------------------------------------------+---------------+---------+----------------------+-------+-------------+\ 2 rows in set (0.01 sec)\ \ \ (2)\ select page0_.CONTENTID as CONTENTID0_, comments1_.CONTENTID as CONTENTID1_,\ children2_.CONTENTID as CONTENTID2_, page0_.CHILD_POSITION as CHILD_P13_0_,\ page0_.PARENTID as PARENTID0_, page0_.SPACEID as SPACEID0_, page0_.TITLE as TITLE0_,\ page0_.VERSION as VERSION0_, page0_.CREATOR as CREATOR0_, page0_.CREATIONDATE as\ CREATION6_0_, page0_.LASTMODIFIER as LASTMODI7_0_, page0_.LASTMODDATE as LASTMODD8_0_,\ page0_.VERSIONCOMMENT as VERSIONC9_0_, page0_.PREVVER as PREVVER0_, page0_.CONTENT_STATUS\ as CONTENT11_0_, comments1_.PAGEID as PAGEID1_, comments1_.PARENTCOMMENTID as\ PARENTC21_1_, comments1_.TITLE as TITLE1_, comments1_.VERSION as VERSION1_,\ comments1_.CREATOR as CREATOR1_, comments1_.CREATIONDATE as CREATION6_1_,\ comments1_.LASTMODIFIER as LASTMODI7_1_, comments1_.LASTMODDATE as LASTMODD8_1_,\ comments1_.VERSIONCOMMENT as VERSIONC9_1_, comments1_.PREVVER as PREVVER1_,\ comments1_.CONTENT_STATUS as CONTENT11_1_, children2_.PAGEID as PAGEID2_,\ children2_.PARENTCOMMENTID as PARENTC21_2_, children2_.TITLE as TITLE2_,\ children2_.VERSION as VERSION2_, children2_.CREATOR as CREATOR2_, children2_.CREATIONDATE\ as CREATION6_2_, children2_.LASTMODIFIER as LASTMODI7_2_, children2_.LASTMODDATE as\ LASTMODD8_2_, children2_.VERSIONCOMMENT as VERSIONC9_2_, children2_.PREVVER as PREVVER2_,\ children2_.CONTENT_STATUS as CONTENT11_2_, children2_.PARENTCOMMENTID as PARENTC21___,\ children2_.CONTENTID as CONTENTID__ from CONTENT page0_ left outer join CONTENT comments1_\ on page0_.CONTENTID=comments1_.PAGEID left outer join CONTENT children2_ on\ comments1_.CONTENTID=children2_.PARENTCOMMENTID, SPACES space3_ where\ page0_.CONTENTTYPE='XXXX' and ((lower(space3_.SPACEKEY)='XXXX' and\ page0_.SPACEID=space3_.SPACEID)and(lower(page0_.TITLE)='XXXX' )and(page0_.PREVVER XXXX\ )and(page0_.CONTENT_STATUS='XXXX' )) order by children2_.CREATIONDATE;\ +----+-------------+------------+--------+-----------------------------------------------+--------------------+---------+----------------------------+-------+----------------------------------------------+\ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |\ +----+-------------+------------+--------+-----------------------------------------------+--------------------+---------+----------------------------+-------+----------------------------------------------+\ | 1 | SIMPLE | page0_ | ref | c_spaceid_idx,c_prevver_idx,c_contenttype_idx | c_prevver_idx | 9 | const | 48627 | Using where; Using temporary; Using filesort | \ | 1 | SIMPLE | space3_ | eq_ref | PRIMARY | PRIMARY | 8 | wikis.page0_.SPACEID | 1 | Using where | \ | 1 | SIMPLE | comments1_ | ref | c_pageid_idx | c_pageid_idx | 9 | wikis.page0_.CONTENTID | 24313 | | \ | 1 | SIMPLE | children2_ | ref | c_parentcommid_idx | c_parentcommid_idx | 9 | wikis.comments1_.CONTENTID | 13 | | \ +----+-------------+------------+--------+-----------------------------------------------+--------------------+---------+----------------------------+-------+----------------------------------------------+\ 4 rows in set (0.00 sec)\ \ \ (3)\ select contentent0_.CONTENTID as x0_0_, contentent0_.VERSION as x1_0_,\ contentent0_.LASTMODIFIER as x2_0_, contentent0_.LASTMODDATE as x3_0_,\ contentent0_.VERSIONCOMMENT as x4_0_ from CONTENT contentent0_ where\ (contentent0_.PREVVER=XXXX )or(contentent0_.CONTENTID=XXXX ) order by \ contentent0_.VERSION desc;\ +----+-------------+--------------+-------------+-----------------------+-----------------------+---------+------+------+-----------------------------------------------------------------+\ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |\ +----+-------------+--------------+-------------+-----------------------+-----------------------+---------+------+------+-----------------------------------------------------------------+\ | 1 | SIMPLE | contentent0_ | index_merge | PRIMARY,c_prevver_idx | c_prevver_idx,PRIMARY | 9,8 | NULL | 62 | Using union(c_prevver_idx,PRIMARY); Using where; Using filesort | \ +----+-------------+--------------+-------------+-----------------------+-----------------------+---------+------+------+-----------------------------------------------------------------+\ 1 row in set (0.00 sec)\ \ \ (4)\ select defaulthib0_.id as id, defaulthib0_.name as name, defaulthib0_.password as\ password, defaulthib0_.email as email, defaulthib0_.created as created,\ defaulthib0_.fullname as fullname from users defaulthib0_ where (defaulthib0_.name='XXXX'\ );\ +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+-------+-------------+\ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |\ +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+-------+-------------+\ | 1 | SIMPLE | localmembe0_ | ref | PRIMARY,FK6B8FB445CE2B3226 | PRIMARY | 8 | const | 16342 | Using index | \ | 1 | SIMPLE | defaulthib1_ | eq_ref | PRIMARY | PRIMARY | 8 | wikis.localmembe0_.userid | 1 | | \ +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+-------+-------------+\ 2 rows in set (0.00 sec)\ \ \ (5)\ select localmembe0_.groupid as groupid__, localmembe0_.userid as userid__, defaulthib1_.id\ as id0_, defaulthib1_.name as name0_, defaulthib1_.password as password0_,\ defaulthib1_.email as email0_, defaulthib1_.created as created0_, defaulthib1_.fullname as\ fullname0_ from local_members localmembe0_ inner join users defaulthib1_ on\ localmembe0_.userid=defaulthib1_.id where localmembe0_.groupid=XXXX\ +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+------+-------------+\ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |\ +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+------+-------------+\ | 1 | SIMPLE | localmembe0_ | ref | PRIMARY,FK6B8FB445CE2B3226 | PRIMARY | 8 | const | 9056 | Using index | \ | 1 | SIMPLE | defaulthib1_ | eq_ref | PRIMARY | PRIMARY | 8 | wikis.localmembe0_.userid | 1 | | \ +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+------+-------------+\ 2 rows in set (0.00 sec)\ \ \ \ }