Answers.Body: <p>It's strongly recommended NOT to delete data directly via SQL.  I don't think it's possible to say which tables you need to delete from - there are hundreds of tables, not including those added by extensions, and it's impossible for us to know which are in use for you.</p>
  
  <p>Instead, consider the suggestions by Jitendra and Aidan above - the issue is that the server is misconfigured.  Alternatively, consider using the API.  Especially if done from the command line where there should be no <code>max_execution_time</code> set, this should resolve your issue much more cleanly without causing orphan database records.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T16:15:22.503Z
Answers.LastActivityDate: 2018-08-31T16:15:22.503Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I'm tried to delete contacts group (basically entire contacts from the particular group), getting Gateway timed out error and only few contacts are getting deleted. </p>
  
  <p>So I'm planning to delete contacts from the database. It quite complicated, customer details are stored in different tables.  </p>
  
  <p>If I go through the database approach what all the tables I need to join to get all contacts deleted from a group? </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T08:28:51.297Z
Comments.Text: Are you trying to remove the contacts from a group, or delete the actual contacts?
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T08:34:38.250Z
Comments.Text: Deleting actual contacts. Not removing contacts from the group.
Comments.UserDisplayName: Ashwin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T08:40:10.677Z
Comments.Text: Try increasing max execution time in php.ini rather than going for hardcoded deletion from database.
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T08:44:21.670Z
Comments.Text: - and if you can't change php.ini, try deleting the contacts in smaller batches.
Comments.UserDisplayName: Aidan
Tags: <joomla><database><groups><delete><civicrm-contact>
Title: Delete contacts from group
ThreadText: # Delete contacts from group
  
  (Asked by: username_0 on 2018-08-31)
  
  I'm tried to delete contacts group (basically entire contacts from the particular group), getting Gateway timed out error and only few contacts are getting deleted.
  
  So I'm planning to delete contacts from the database. It quite complicated, customer details are stored in different tables.
  
  If I go through the database approach what all the tables I need to join to get all contacts deleted from a group?
  
  **Tags:** joomla, database, groups, delete, civicrm-contact
  
  > **Comments:**
  > **username_1**: Are you trying to remove the contacts from a group, or delete the actual contacts?  
  > **username_0**: Deleting actual contacts. Not removing contacts from the group.  
  > **username_2**: Try increasing max execution time in php.ini rather than going for hardcoded deletion from database.  
  > **username_1**: - and if you can't change php.ini, try deleting the contacts in smaller batches.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-08-31. Score: 2
  
  It's strongly recommended NOT to delete data directly via SQL. I don't think it's possible to say which tables you need to delete from - there are hundreds of tables, not including those added by extensions, and it's impossible for us to know which are in use for you.
  
  Instead, consider the suggestions by username_2 and username_1 above - the issue is that the server is misconfigured. Alternatively, consider using the API. Especially if done from the command line where there should be no `max_execution_time` set, this should resolve your issue much more cleanly without causing orphan database records.
  
  
  ---
  
  