Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

Optimisation Tip

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


ic at tvcables

Jul 30, 2013, 1:47 PM

Post #1 of 4 (41 views)
Permalink
Optimisation Tip

Hi Folks,

Whilst trying to optimise IC for speed today I noticed a slow sql query
every time an order was updated, I eventually traced it to /etc/ship_notice

This loop tag:-

[loop prefix=item search="
fi=orderline
st=db
sf=order_number
se=[loop-code]
ml=1000
"]

Produces an sql query of select * from orderline;

If the orderline table has a few hundred thousand rows it returns them all
and causes quite a delay, I replaced it with:-

[query
prefix=item
sql=|select * from orderline where order_number = '[loop-code]'|
type=list
]
[item-list]

Then used [item-param column_name] for the columns in the email, now its
lightning quick at updating an order.

Andy


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


racke at linuxia

Jul 30, 2013, 11:58 PM

Post #2 of 4 (39 views)
Permalink
Re: Optimisation Tip [In reply to]

On 07/30/2013 10:47 PM, IC wrote:
> Hi Folks,
>
> Whilst trying to optimise IC for speed today I noticed a slow sql query
> every time an order was updated, I eventually traced it to /etc/ship_notice
>
> This loop tag:-
>
> [.loop prefix=item search="
> fi=orderline
> st=db
> sf=order_number
> se=[loop-code]
> ml=1000
> "]
>
> Produces an sql query of select * from orderline;
>
> If the orderline table has a few hundred thousand rows it returns them all
> and causes quite a delay, I replaced it with:-
>
> [.query
> prefix=item
> sql=|select * from orderline where order_number = '[loop-code]'|
> type=list
> ]
> [item-list]
>
> Then used [item-param column_name] for the columns in the email, now its
> lightning quick at updating an order.
>

Do you mind to produce a patch or even a Github pull request to get
this into the Interchange repository?

Regards
Racke



--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


mike at perusion

Jul 31, 2013, 4:53 AM

Post #3 of 4 (39 views)
Permalink
Re: Optimisation Tip [In reply to]

Quoting Stefan Hornburg (Racke) (racke [at] linuxia):
> On 07/30/2013 10:47 PM, IC wrote:
> > Hi Folks,
> >
> > Whilst trying to optimise IC for speed today I noticed a slow sql query
> > every time an order was updated, I eventually traced it to /etc/ship_notice
> >
> > This loop tag:-
> >
> > [.loop prefix=item search="
> > fi=orderline
> > st=db
> > sf=order_number
> > se=[loop-code]
> > ml=1000
> > "]
> >
> > Produces an sql query of select * from orderline;
> >
> > If the orderline table has a few hundred thousand rows it returns them all
> > and causes quite a delay, I replaced it with:-
> >
> > [.query
> > prefix=item
> > sql=|select * from orderline where order_number = '[loop-code]'|
> > type=list
> > ]
> > [item-list]
> >
> > Then used [item-param column_name] for the columns in the email, now its
> > lightning quick at updating an order.
> >
>
> Do you mind to produce a patch or even a Github pull request to get
> this into the Interchange repository?

I think that introducing co=1 and op=eq into the search spec will have
the same effect, i.e..

[loop prefix=item search="
fi=orderline
st=db
sf=order_number
se=[loop-code]
co=1
op=eq
ml=1000
"]

That may not be as intuitive as the query, but when mv_coordinate (co) = 1 and
the spec is an eq, it generates that query as the initial search selection.

I have made that patch for now, so if it is verified to work
then we can use it.

--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.765.253.4194 ... Ask me about jobs ...

Fast, reliable, cheap. Pick two and we'll talk.
-- unknown

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


racke at linuxia

Jul 31, 2013, 5:55 AM

Post #4 of 4 (39 views)
Permalink
Re: Optimisation Tip [In reply to]

On 07/31/2013 01:53 PM, Mike Heins wrote:
> Quoting Stefan Hornburg (Racke) (racke [at] linuxia):
>> On 07/30/2013 10:47 PM, IC wrote:
>>> Hi Folks,
>>>
>>> Whilst trying to optimise IC for speed today I noticed a slow sql query
>>> every time an order was updated, I eventually traced it to /etc/ship_notice
>>>
>>> This loop tag:-
>>>
>>> [.loop prefix=item search="
>>> fi=orderline
>>> st=db
>>> sf=order_number
>>> se=[loop-code]
>>> ml=1000
>>> "]
>>>
>>> Produces an sql query of select * from orderline;
>>>
>>> If the orderline table has a few hundred thousand rows it returns them all
>>> and causes quite a delay, I replaced it with:-
>>>
>>> [.query
>>> prefix=item
>>> sql=|select * from orderline where order_number = '[loop-code]'|
>>> type=list
>>> ]
>>> [item-list]
>>>
>>> Then used [item-param column_name] for the columns in the email, now its
>>> lightning quick at updating an order.
>>>
>>
>> Do you mind to produce a patch or even a Github pull request to get
>> this into the Interchange repository?
>
> I think that introducing co=1 and op=eq into the search spec will have
> the same effect, i.e..
>
> [.loop prefix=item search="
> fi=orderline
> st=db
> sf=order_number
> se=[loop-code]
> co=1
> op=eq
> ml=1000
> "]
>
> That may not be as intuitive as the query, but when mv_coordinate (co) = 1 and
> the spec is an eq, it generates that query as the initial search selection.
>
> I have made that patch for now, so if it is verified to work
> then we can use it.
>

Thanks for the quick fix, Mike!

Regards
Racke

--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.