问题
I am developing a site that will fetche reviews on various renowned car dealers (i.e. Fordham Toyota, Westchester Toyota, Toyota Of Manhattan etc.) from major review sites like CitySeach, Dealer Rater, Insider Pages, Yelp, Yahoo-local, Google+ etc. Basically the functionality of this site is to allow business owners to monitor their online reviews on major review sites.
I am using codeigniter and datamapper (version 1.8) in this project and facing some problems to delete data from mysql database.
Here is my part of table structures as follows:
+----------+ +----------------+ +--------------+
| profiles | | profiles_users | | users |
+----------+ +----------------+ +--------------+
| id |<---- | id |----->| id |
| name | | profile_id | | name |
+----------+ | user_id | | email |
| +----------------+ | password |
| +--------------+
+--> +--------------+
| reviews |
+--------------+
| id |
| title |
| author |
| review |
| rating |
| date |
| profile_id |
+--------------+
In the "profile" table I am storing the delar name (i.e like Fordham Toyota, Westchester Toyota etc.) and in "user" table I am storing the name of the business owners. I am using the api to fetch reviews and store them within "reviews" table with "profile-id".
There may be more than 20000 reviews for each profile. Presently I have avg. 12000 reviews per profile.
Whenever I am going to delete a profile, the reviews for that profile should be deleted , but here I get an error message like :
"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20 bytes) in /home/business/public_html/system/database/DB_active_rec.php on line 1999"
Can anybody please suggest me in this regard.
来源:https://stackoverflow.com/questions/17940067/unable-to-delete-more-than-20000-records-from-mysql-database-using-codeigniter-d