Results 1 to 10 of 21

Hybrid View

  1. #1
    Join Date
    Sep 2012
    Posts
    253
    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.

  2. #2
    Join Date
    Sep 2012
    Posts
    253
    Plugin Contributions
    0

    Default Re: Database user permisions

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

  3. #3
    Join Date
    Jul 2012
    Posts
    16,817
    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...

  4. #4
    Join Date
    Sep 2012
    Posts
    253
    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.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    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...

  6. #6
    Join Date
    Sep 2012
    Posts
    253
    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?

  7. #7
    Join Date
    Sep 2012
    Posts
    253
    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

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Database user permisions

    Quote Originally Posted by southshorepizza View Post
    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
    I guess the simple answer here is that this is used to timeout any session data, whether it be for the customer or user logins or site accesses.

    This is also unimportant information. The fact that the query itself is causing a server timeout (which I assume is what hostgator are telling you) IS important, and in my experience it generally means that the Sessions database table has become corrupted.

    You can check/rectify this by running the 'repair database' function provided by phpmyadmin, the 'MySql database' tool found in most cPanels, or almost any other DB administration tool at your disposal.

    Cheers
    RodG

  9. #9
    Join Date
    Jul 2012
    Posts
    16,817
    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...

 

 

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

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