Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Database Size
(1 viewing) (1) Guest
component
Go to bottomPage: 1
TOPIC: Database Size
#2434
Database Size 15 Years, 2 Months ago Karma: 0
ariquizstatistics table has become very large. can I clean the table by deleting all unnecessary rows? i.e., can I delete all statistics relating to guest?
or if the database size is more, can i create another database and store in that?
The administrator has disabled public write access.
 
#2435
Re:Database Size 15 Years, 2 Months ago Karma: 760
Hello,

You can use the following SQL query for clearing guest results:

Code:


DELETE 
QSI, QS 
FROM
jos_ariquizstatisticsinfo QSI,jos_ariquizstatistics QS
WHERE
QSI.StatisticsInfoId = QS.StatisticsInfoId
    AND
QSI.UserId = 0



Regards,
ARI Soft
The administrator has disabled public write access.
 
#65880
Re:Database Size 4 Years, 11 Months ago Karma: 0
I believe you should include the ariquizstatistics_pages as well, then also do a optimize on the tables to reduce their size
getafix
What goes around comes around.
User Offline Click here to see the profile of this user
Gender: Male GetafixZA Getafix IT Solutions
The administrator has disabled public write access.
 
#65881
Re:Database Size 4 Years, 11 Months ago Karma: 0
In my case I thought on saving database space was to accomplish the following:
To remove all records from the different statistics pages where the jos_ariquizstatistics status is not Finished and the StartDate is older than 2 days. I am not interested in tests not completed older than 2 days old, and a lot of users or guests start the quizzes and decide it is not for them and quit, so I do not want those results.
The reason for the older than 2 days records then I do not interfere with current tests that might be taken. In my case I queried where the Status <> "Finished", but in your case you might want to replace that with UserId = 0
Then remember to optimize your tables to reduce the size.

Here's my code:

-----------------------------------------------------------------
--CHECK TABLE SIZES (do copy paste the results somewhere to compare afterwards)
-----------------------------------------------------------------
SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES WHERE table_name in('jos_ariquizstatisticsinfo' ,'jos_ariquizstatistics','jos_ariquizstatistics_pages') ORDER BY `Size in MB` DESC;

-----------------------------------------------------------------
--DELETE RECORDS
-----------------------------------------------------------------
DELETE
QSI, QS, QSP
FROM
jos_ariquizstatisticsinfo QSI,jos_ariquizstatistics QS,jos_ariquizstatistics_pages QSP
WHERE
QSI.StatisticsInfoId = QS.StatisticsInfoId AND QS.PageId = QSP.PageId
AND
(QSI.Status <> "Finished") and (QSI.StartDate < now() - interval 2 DAY);

------------------------------------------------------------------
--OPTIMIZE TABLES TO REDUCE SIZE
-----------------------------------------------------------------
optimize table jos_ariquizstatisticsinfo ,jos_ariquizstatistics,jos_ariquizstatistics_pages;

------------------------------------------------------------------
--SEE THE TABLE SIZES NOW
-----------------------------------------------------------------
SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES WHERE table_name in('jos_ariquizstatisticsinfo' ,'jos_ariquizstatistics','jos_ariquizstatistics_pages') ORDER BY `Size in MB` DESC;

AriSoft, do you agree?
Kind Regards
getafix
What goes around comes around.
User Offline Click here to see the profile of this user
Gender: Male GetafixZA Getafix IT Solutions
The administrator has disabled public write access.
 
#65884
Re:Database Size 4 Years, 11 Months ago Karma: 760
Hello,

It is valid solution to delete old results.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1