Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Database user permisions

    Again, and I realize the post was edited after I began response, the date "filter" does not eliminate anything. The "60% reduction" comes from the like and b.status portions of the query. It also does not prove that indexing is being optimized and I am still unable to identify the indices available as I'm not at a computer nor able to "easily" pull up the index list for the orders table.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #12
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Database user permisions

    Would want something like date_purchased > DATE(CURRENT_DATE() - INTERVAL 2 WEEK)

    Which is an example of 2 weeks ago, would need to find the interval information necessary to accomodate your criteria.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Database user permisions

    Actually that is part of that customization. There are future orders. But the query should be tweaked so it's between 00:00:00 and now.

  4. #14
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Database user permisions

    date_purchased BETWEEN DATE(CURRENT_DATE() - INTERVAL 1 DAY) AND NOW() ORDER BY orders_id DESC;

  5. #15
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Database user permisions

    Quote Originally Posted by southshorepizza View Post
    Actually that is part of that customization. There are future orders. But the query should be tweaked so it's between 00:00:00 and now.
    Untested, but:

    Code:
    DATE(date_purchased) = DATE(CURRENT_DATE()) and date_purchased < NOW()
    Would query on all orders for the current date (current and "future", assume though that you have more past orders than future orders.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #16
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Database user permisions

    Quote Originally Posted by southshorepizza View Post
    date_purchased BETWEEN DATE(CURRENT_DATE() - INTERVAL 1 DAY) AND NOW() ORDER BY orders_id DESC;
    If not mistaken that pulls from the day before to now, instead of the start of today to now... Also I thought I read something about mixing the date/format types might be an issue (DATE versus datetime)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #17
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Database user permisions

    Yes that pulled the last 24 hours. I like yours better so I just updated it to your suggestion. Thank you. It still seems to be taking the same amount of time to load the page. Maybe because we don't have a lot of data being returned maybe because of the host. But your query is definitely better than what was there.

  8. #18
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Database user permisions

    Also, these are the indices that I found on a ZC 1.5.3 install:
    Code:
    Keyname Type Cardinality Field
    PRIMARY PRIMARY 18 orders_id
    idx_status_orders_cust_zen INDEX 18 orders_status
    orders_id
    customers_id
    idx_date_purchased_zen INDEX 18 date_purchased
    idx_cust_id_orders_id_zen INDEX 18 customers_id
    orders_id
    So basically like the idx_status_orders_cust_zen index gets used when the query has WHERE orders_status = xxx and orders_id = yyy and customers_id = zzz, so yes by using the date_purchased field first at least one index is used...

    But, it seems that the queries that are taking the longest are ones that don't really limit the results, but instead ask for all orders that are in the past.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #19
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Database user permisions

    Thank you. Those two I posted are the ones that query twice a minute. I will set the other one up that I posted the same as the one we just discussed. Otherwise the queries should not be that stressful as order taking would be the majority of all other queries. We run reports every now and then but that would be maybe 10 or 15 in an entire day. So back to the original questions. Is it possible that the tables are on the wrong engine and need to be switched as there is too much activity to support table locking or is the hosting company giving a cop out to poor server performance?

  10. #20
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Database user permisions

    According to hostgator queries such as this one keep timing out. Can anyone give some guidance as to what it is actually used for? Is it the 15 minute admin log in? When looking at my site they say this is constantly an issue.

    Code:
    select value from zen_sessions where sesskey = '49ef1a7910977c50ba19085ec8cffcea' and expiry > '1425149368'
    Thanks

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v151 Fantasatico upgrade has changed permisions for my admin
    By girlboheme in forum Upgrading to 1.5.x
    Replies: 5
    Last Post: 9 Mar 2014, 01:58 PM
  2. PHP File Permisions
    By Advantage Online in forum General Questions
    Replies: 3
    Last Post: 24 Jan 2011, 11:34 PM
  3. file permisions
    By tenerifetom in forum Installing on a Linux/Unix Server
    Replies: 12
    Last Post: 6 Apr 2010, 02:24 PM
  4. EZ-Pages Permisions error after editing
    By snellc in forum Installing on a Windows Server
    Replies: 2
    Last Post: 5 Apr 2009, 10:53 PM
  5. Write only permisions on configure.ini
    By couchie in forum Installing on a Windows Server
    Replies: 4
    Last Post: 27 Apr 2007, 04:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR