Post by hellreturn » Fri Aug 24, 2012 6:03 pm

Hello,

How can i add indexes for below query?

Code: Select all

SELECT count(pa.product_id) as total FROM product_attribute pa JOIN product p ON pa.product_id = p.product_id WHERE 
                                    (pa.text = 'Gold')
                                AND pa.product_id IN (70,71,72,73,74,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104)
				    AND pa.language_id=1
				    AND pa.attribute_id=15
				    AND p.status = 1;


SELECT count(pa.product_id) as total FROM product_attribute pa JOIN product p ON pa.product_id = p.product_id WHERE 
                                    (pa.text = 'Black')
                                AND pa.product_id IN (70,71,72,73,74,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104)
				    AND pa.language_id=1
				    AND pa.attribute_id=19
				    AND p.status = 1;

New member

Posts

Joined
Tue May 29, 2012 4:21 am

Post by hellreturn » Sun Aug 26, 2012 7:37 pm

Anyone?

Thanks

New member

Posts

Joined
Tue May 29, 2012 4:21 am

Post by oc-extensions » Mon Aug 27, 2012 5:37 pm

I think table `product_attribute` have already indexes (Unique) for columns product_id , attribute_id and language_id

Image | Extensions and Custom Development


User avatar
Active Member

Posts

Joined
Fri Jan 06, 2012 11:31 pm
Who is online

Users browsing this forum: No registered users and 144 guests