哪一个是好的mysql或csv来读取php中的数据

I have two option to read data either by CSV or by mySql. The data is too larger i.e. having 30000 rows. Can some one tell me which one is best in basis of time. I am using language PHP. Please tell me the best with comparison on basis of time and data size. ie.

No of rows : Time taken to read by mysql : Time taken to read by CSV

1000: .07sec: .6sec

30000: .123 sec : 30sec

Can some one help me to decide which one is best according to number of rows.

thanks

If your dataset is very large, I would recommend a MySQL based table, with correctly placed indexes. Will speed up your fetching time substantially.

I would go with mysql because it has a lot more benefits of you would want to do anything else with the data later... And large files read by PHP could end up in memory, so not really what you would want...

It completely depends on the data. If your data has relation MySQL will perform better. And you dnt have to store redundant data. If the data has no relation you can use csv.

I suggest you use MySQL for either case. Because itll provide faster searching and other optimizations. Even if your data is csv friendly, MySQL has csv engine where you can store csv data.

mysql is always better when using php. in terms of database support or in any other form ,it is more suitable. So you should go with mysql.

Just a suggestion: i do not have numbers...

If you always read the entire block of rows, so you don't need to filter out some rows from the resultset then it's better to read the rows direclty from a csv file.

You access only the filesystem.

With a db. You have send the query to the DBMS via tcp/ip then the DBMS access the filesystem and sends the result via tcp/ip again...