I am having about 30,000 of orders(records).
And from controller i send an email with CSV of orders(records) using Delayed Job for background processing. Code is like -

```
OrderNotifier.delay.send_orders_csv(current_user, arranged_orders)

```

And in mailer -

```
  def send_orders_csv(logged_in_user, orders)
     @user = logged_in_user
     attachments['orders.csv'] = { mime_type: 'text/csv', content: Order.orders_csv(logged_in_user, orders) }
     mail(to: logged_in_user.email, subject: 'Orders CSV')
  end

```

And when it inserts row into Delayed::Job it takes a lot time because there are almost 30,000 of records that i need to send as CSV attachment.
I have tried with increasing delayed\_job workers. But it didn't resolve it.

How can i send an email with the huge amount of records in CSV file at once?