Click here to Skip to main content
15,885,086 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I want to know witch of the below is better and good performance?
1- store file duration in data base and fetch it
2- get file duration from FileInfo class
Thanks
Posted

1 solution

If you mean the file size, then it's a bit of a silly question - it's going to depend on too many factors. Firstly, are you fetching anything else from the same row of the database? For example, if you are fetching the file path from the DB already, then it will take a trivial extra amount of time to add the file size to that request, while fetching it separately from the folder structure will add seek times and so forth making that likely to be a longer operation.

Secondly, there is the accuracy problem: how up-to-date does the size have to be? If the file is unchanging between the file info being written to the DB and when the info is read out, then it isn;t a problem. But...if the user can update the file in any way after the info is written, then it can quickly become useless.

Sorry, we can't make that decision for you - you will have to look at exactly what you are trying to achieve and work from there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900