开发者

Better performance on ReadOnly database

开发者 https://www.devze.com 2023-03-20 18:51 出处:网络
I am using Firebird in my app. There is a database that receives load once a day. The rest of the day the queries are read-only (select queries).

I am using Firebird in my app. There is a database that receives load once a day. The rest of the day the queries are read-only (select queries).

Is there any way of improving performance? For example, I don't need the concurrency control of the database because I will make just SELECT queries.

开发者_StackOverflow

Thanks


How much of the database is needed everyday? You might be reading small part of the data and thus you can cache the data at application layer and save database call completely.

Since the record in the database is readonly, you can use SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED and prevent any locking on the table. This most of the time improves scalability significantly. I put this on all my read SPs nowadays since it has saved me many times.


Since there are a lot of reads from database you can use indexes heavily if necessary. This could speed up queries with filtering and sorting.

Database engine automatically manages concurrency and doesn't lock database objects if there are only SELECT queries to it. So I don't think you should consider this area as a way for perfomance improvement.


Assuming that the load process can be lengthy, you can rebuild your indexes at the end of it. This removes all index fragmentation and can improve select performance.

0

精彩评论

暂无评论...
验证码 换一张
取 消