I am making an online app in which when I sync my data web then 25 to 30 local database queries in different tables are executed. So it will take around 25 to 30 sec because all database queries are execute in this manner, first check that data is present or not in local database if present then row is update otherwise insert. Now I want to ask that there are any way through which I can execute these all queries concurrently. If I can do this then I can save my 10 to 15 sec in every sync. So please gave a better solution to execute multiple queries.
我正在做一个在线应用程序,当我同步我的数据网络时,在不同的表中执行25到30个本地数据库查询。因为所有数据库查询都是以这种方式执行的,所以大约需要25到30秒的时间,首先要检查数据是否存在于本地数据库中,如果存在,则行更新否则插入。现在我想问,有什么方法可以同时执行这些查询。如果我能做到这一点,我就能在每次同步中节省10到15秒。所以请给出一个更好的解决方案来执行多个查询。
3 个解决方案
#1
2
Consider using High Performance database management system such as cubeSQL :
考虑使用高性能数据库管理系统,如cubeSQL:
SQLabs has announced the release of cubeSQL a fully featured and high performance relational database management system built on top of the sqlite database engine. It is the ideal database server for both developers who want to convert a single user database solution to a multiuser project and for companies looking for an affordable, easy to use and easy to maintain database management system. cubeSQL runs on Windows, Mac, Linux and it can be embedded into any iOS and Cocoa application.
SQLabs已经发布了一个功能完备的、高性能的关系数据库管理系统,它是在sqlite数据库引擎的基础上构建的。对于希望将单个用户数据库解决方案转换为多用户项目的开发人员以及希望找到价格合理、易于使用和易于维护的数据库管理系统的公司来说,它是理想的数据库服务器。cubeSQL在Windows、Mac和Linux上运行,可以嵌入到任何iOS和Cocoa应用程序中。
cubeSQL is incredibly fast, has a small footprint, is highly reliable and it offers some unique features. It can be easily accessed with any JSON client, with PHP, with the native C SDK, with a Windows DLL and with an highly optimized REAL Studio plugin.
cubeSQL速度快得难以置信,占地面积小,非常可靠,并且提供了一些独特的特性。它可以通过任何JSON客户机、PHP、本地C SDK、Windows DLL和高度优化的REAL Studio插件轻松访问。
#2
1
It is not possible to run 2 or more than two queries at a single time cause when 1 query runs it locks the DataBase.
一次运行两个或两个以上的查询是不可能的,因为当一个查询运行时,它会锁定数据库。
#3
1
If all queries you want to execute that relates to the different table then in that case you can create the Separate Database File for every Table.
如果您希望执行的与不同表相关的所有查询,那么在这种情况下,您可以为每个表创建单独的数据库文件。
#1
2
Consider using High Performance database management system such as cubeSQL :
考虑使用高性能数据库管理系统,如cubeSQL:
SQLabs has announced the release of cubeSQL a fully featured and high performance relational database management system built on top of the sqlite database engine. It is the ideal database server for both developers who want to convert a single user database solution to a multiuser project and for companies looking for an affordable, easy to use and easy to maintain database management system. cubeSQL runs on Windows, Mac, Linux and it can be embedded into any iOS and Cocoa application.
SQLabs已经发布了一个功能完备的、高性能的关系数据库管理系统,它是在sqlite数据库引擎的基础上构建的。对于希望将单个用户数据库解决方案转换为多用户项目的开发人员以及希望找到价格合理、易于使用和易于维护的数据库管理系统的公司来说,它是理想的数据库服务器。cubeSQL在Windows、Mac和Linux上运行,可以嵌入到任何iOS和Cocoa应用程序中。
cubeSQL is incredibly fast, has a small footprint, is highly reliable and it offers some unique features. It can be easily accessed with any JSON client, with PHP, with the native C SDK, with a Windows DLL and with an highly optimized REAL Studio plugin.
cubeSQL速度快得难以置信,占地面积小,非常可靠,并且提供了一些独特的特性。它可以通过任何JSON客户机、PHP、本地C SDK、Windows DLL和高度优化的REAL Studio插件轻松访问。
#2
1
It is not possible to run 2 or more than two queries at a single time cause when 1 query runs it locks the DataBase.
一次运行两个或两个以上的查询是不可能的,因为当一个查询运行时,它会锁定数据库。
#3
1
If all queries you want to execute that relates to the different table then in that case you can create the Separate Database File for every Table.
如果您希望执行的与不同表相关的所有查询,那么在这种情况下,您可以为每个表创建单独的数据库文件。