sqlite - Slow Performance of Sql Query -


i writing sql query gives me slow performance. because of gives me 504 gateway timeout problem. please me remake query output results faster. put query below.

select    r.c1,   parent_item.c2,   parent_item.c3,   parent_item.c4,   parent_item.c5,   parent_item.c6,   parent_item.c7,   pt.c8,   child_item.c9,   t.c10,   child_item.c11,   table1 child_item,   table2 t,   table3 r,   table1 parent_item,   table4 pt   r.col1 = child_item.id ,   t.id=child_item.typeid ,   parent_item.id = r.parent_itemid ,   pt.id = parent_item.typeid  , parent_item.id=800 ,    parent_item.id = (select                       itemid                                           table5                                           itemid=parent_item.id                        ((10!= 1) ?  , (holder_itemid in (10,100) , level > 0): "")) ,   child_item.id = (select                      itemid                                         table5                                         itemid=child_item.id                        ((10 != 1) ?  , (holder_itemid in (10,100) , level > 0) : "")) order   r.parent_itemid,   r.relation_typeid,   r.ordinal 

it's 2 sub-queries, don't have enough information schema.

you should run query though explain , see says.

joins might help, again, can't tell sure.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -