It’s much cheaper to retrieve data from the file rather than database if I understand correctly. So, why when we use SELECT, MySQL doesn’t retrieve data from the file which would be created or updated everytime we use UPDATE, INSERT, DELETE etc? There reason is security issues?
It’s much cheaper to retrieve data from the file rather than database if I
Share
Ask yourself: what is a database? It’s a program that stores data, somehow, somewhere, and lets you retrieve it again. The database stores this data in files as well behind the scenes, somehow, somewhere. MySQL typically runs as a daemon. You contact that daemon and ask it for data. Where that data comes from is entirely up to MySQL. Many times it will retrieve this data out of RAM, which is much less expensive than opening a file and reading it from there. If the data does not happen to already be in RAM, then it will retrieve it from a file.
So, your question is misguided. MySQL does get the data from a file at some point. That is not necessarily “much cheaper” though. It may or may not be cheaper to get it from a database which keeps the data in RAM.