Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Performance optimization Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
bayronp.al
Newbie
Newbie
Avatar

Joined: 13 January 2014
Online Status: Offline
Posts: 7
Posted: 08 July 2014 at 3:27pm | IP Logged Quote bayronp.al

Good afternoon, it would be possible to optimize the performance of this query?
Regards and thanks in advance

SELECT p.id_folder, p.id_parent, p.type, p.name, p.full_path, p.sync_type, p.hide, p.fld_order, p.flags,
     COUNT(messages.id) AS message_count, COUNT(messages_unread.seen) AS unread_message_count,
     SUM(messages.size) AS folder_size, MAX(folder_level) AS level
FROM (awm_folders as n, awm_folders_tree as t, awm_folders as p)
LEFT OUTER JOIN awm_messages AS messages ON p.id_folder = messages.id_folder_db
LEFT OUTER JOIN awm_messages AS messages_unread ON
     p.id_folder = messages_unread.id_folder_db AND
     messages.id = messages_unread.id AND messages_unread.seen = 0
WHERE n.id_parent = -1
     AND n.id_folder = t.id_parent
     AND t.id_folder = p.id_folder
     AND p.id_acct = 8
GROUP BY p.id_folder
ORDER BY p.fld_order;

Back to Top View bayronp.al's Profile Search for other posts by bayronp.al
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 09 July 2014 at 2:04am | IP Logged Quote Igor

I understand this is about queries used in v6 of the product. In current one, folders are no longer stored in the database, which prove to be more efficient compared to optimizing that query. If you wish to optimize it, I suggest to look into this guide:

Optimizing Queries with EXPLAIN

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide