How to reduce the time needed to export a view with 50k rows into a CSV file? I am having a view with 50k records I want to export the view as CSV. I tried Views data export module but it takes around 20 min to export the data.

I have configured the view to use Batch export with Segment size 100.
I want to reduce the export time. Is there any way to do it?
As an alternative to using Views (and Views data export), you may want to give it a try using the Forena module (disclosure: I'm a co-mainter). If you do, I doubt it'd take 20 mins to complete such export (my bet is somewhere around 30 to 60 secs, at max ...).

To perform such export using Forena, just create a "report" to select (and sort, etc) the 50K records you want to export using the Forena module. And specify what kind of hyperlinks you want to make available for performing such "export". These hyperlinks correspond to various supported "formats", such as: CSV, PDF, XLS, XML, DOC, HTML ... (the "report designer" selects what the allowed/enabled export formats for a report are).

To get an idea of how that would look like, visit the Customized Simple Table of States. Notice the links in it, such as "CSV" (upper right), which in this case would "export" the results in a CSV file.