Slow performance of query

Posted by user642378 on Stack Overflow See other posts from Stack Overflow or by user642378
Published on 2011-03-03T06:12:03Z Indexed on 2011/03/03 7:24 UTC
Read the original article Hit count: 90

Filed under:

Hi,

I have asked the performance of query and i tried to simplyfy it.but still it not works.I am adding my query below.Please can you simplify it more effectively

select 
    r.parent_itemid f_id,
    parent_item.name f_name,
    parent_item.typeid f_typeid,
    parent_item.ownerid f_ownerid,
    parent_item.created f_created,
    parent_item.modifiedby f_modifiedby,
    parent_item.modified f_modified,
    pt.name f_tname,
    child_item.id i_id,
    t.name i_tname,
    child_item.typeid i_typeid,
    child_item.name i_name,
    child_item.ownerid i_ownerid,
    child_item.created i_created,
    child_item.modifiedby i_modifiedby,
    child_item.modified i_modified,
    r.ordinal i_ordinal
from
    item child_item,
    type t,
    relation r,
    item parent_item,
    type pt
where
    r.child_itemid = child_item.id and
    t.id=child_item.typeid and
    parent_item.id = r.parent_itemid and
    pt.id = parent_item.typeid 
    and parent_item.id in (
        select
            itemid
        from
            permission
        where
            itemid=parent_item.id  and
            (holder_itemid in (10,100) and level > 0) )
order by
    r.parent_itemid,
    r.relation_typeid,
    r.ordinal

Thanks you regards jennie

© Stack Overflow or respective owner

Related posts about sqlite