0

Apparently while optimizing Drupal 6 performance, I found that somewhere DISTINCT is getting added into VIEWS query without added by any means like VIEWS UI or hook_views_query_alter.

When tested with devel module, found that the SELECT query getting executed have the DISTINCT clause. I am having VIEW displayed in a block shows latest 10 nodes. VIEWS's Live Preview doesn't show any DISTINCT added in SELECT statement, but same query when executed at front end shows DISTINCT in devel query log.

I am not understanding where its getting added? Is there any way to remove ?

  • Check for just hook_query_alter, as opposed to hook_views_query_alter. – Letharion Feb 12 '13 at 8:32
  • I don't find api For D6 hook_query_alter. – Asif Mulla Feb 12 '13 at 8:37
  • You're right, it wasn't available in D6. There could still be an equivalent hook that I don't recall though. Actually, yes db_rewrite_sql. – Letharion Feb 12 '13 at 9:36

Your Answer

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

Browse other questions tagged or ask your own question.