Unable to delete more than 20000 records from mysql database using codeigniter datamapper

我是研究僧i 提交于 2020-01-16 14:04:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!