Skip to content

Removing Users taking too long Cake Acl #157

@sanjeevrouhan

Description

@sanjeevrouhan

I am removing records from users table, and it is taking too long aprox 1 min to delete a record from users and other table of ACL. How to speed this process up because i have more than 1 lakh entries in table to remove
I am Using this code to remove users

$users = $this->Users->find()->where(['group_id' => 3]);

foreach($users as $key => $value){
    $id = $value->id;
    if($id){
       $user = $this->Users->get($id);
        $this->Users->delete($user);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions