7

I have a basic view that shows a list of members and their user points. The views query output show that this query takes over 1500ms to run.

Query build time 24.71 ms

Query execute time 1546.84 ms

View render time 88.29 ms

SELECT users.picture AS users_picture, users.uid AS uid, users.name AS users_name, users.mail AS users_mail, users.created AS users_created, userpoints_total.points AS userpoints_total_points, 'user' AS field_data_field_motorcycle_user_entity_type, 'user' AS field_data_field_review_count_user_entity_type, 'user' AS field_data_field_address_user_entity_type

FROM {users} users LEFT JOIN {userpoints_total} userpoints_total ON users.uid = userpoints_total.uid WHERE (( (users.status <> '0') AND (users.uid NOT IN ('1')) )) LIMIT 10 OFFSET 0

When I copy and paste that query into myphpadmin and run it there it takes less than 5ms. What else is happening in the "Execute Time"? I coudn't find any good help about that on the web.

7

When testing be sure to turn off the query cache SET SESSION query_cache_type = OFF

Next step is to run EXPLAIN on the sql.

EXPLAIN SELECT users.picture AS users_picture, users.uid AS uid, users.name AS users_name, users.mail AS users_mail, users.created AS users_created, userpoints_total.points AS userpoints_total_points, 'user' AS field_data_field_motorcycle_user_entity_type, 'user' AS field_data_field_review_count_user_entity_type, 'user' AS field_data_field_address_user_entity_type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.