[ic] flypage / IC efficiency?
IC
ic at tvcables.co.uk
Sat Sep 17 21:35:16 UTC 2016
> I don't know why there are 6 queries, but at least one is required to know
> whether you have a product with that SKU or if instead the missing.html
> special page should be shown.
>
> See sub Vend::Interpolate::fly_page for all the details.
Well, I think I've found the cause of this, I can't write perl code like
this and I certainly couldn't have coded this but I can see what's wrong
with it.
It first checks to see if the sku exists, then it looks for a template page,
this is 2 queries.
Then in Track.pm (sub view_product) it gets the description and category
(why?), when it does this though it checks again the sku exists each time,
so that's another 4 queries.
That's the minimum 6 queries that even a blank flypage will generate.
Then each time an [item] tag is used or an [if-item] not only does it
generate a query for the tag it checks if the sku exists every time, so if
you have 20 [item] tags you get a further pointless 20 'select sku' queries,
this is why the strap and standard flypage generate over 30 queries for a
single product view.
The IC core is highly inefficient, it generates 2 mysql queries for every
item tag.
I don't know what the best fix for this is?
Regards,
Andy
More information about the interchange-users
mailing list