PgMex Blog


PostgreSQL-Matlab connectivity

Performance comparison of Postgres connectors in Matlab, Part 3: retrieving arrays

In this paper we continue the investigation of PostgreSQL connectors in Matlab started in Part I and Part II. In the latter paper we compared the performance of data retrieval from PostgreSQL for the case all the fields to be retrieved having scalar types. Compared were two connectors. The first one was Matlab Database Toolbox (working with PostgreSQL via a direct JDBC connection). The second connector is PgMex library (providing a connection to PostgreSQL via libpq library). Here we consider retrieving of data containing values of array types. [Read More]

Performance comparison of PostgreSQL connectors in Matlab, Part II: retrieving scalar data

In Part I of this paper we started our investigation of PostgreSQL connectors in Matlab. Namely, we compared the performance of different approaches to insert data into the PostgreSQL database. Some of those approaches are based on using Matlab Database Toolbox (working with PosgteSQL via a direct JDBC connection). Other ones are based on PgMex library (providing a connection to PostgreSQL via libpq library). Here we continue the comparison of Matlab Database Toolbox and PgMex library considering data retrieval. The given part of this paper covers retrieving only in the most simple case of scalar data, both of numeric and non-numeric types. In the performance benchmarks below we use the same data that was used in the previous article for data insertion benchmarks. As was mentioned previously, this data is based on daily prices of real stocks on some exchanges. Given the nature of such a financial data it is quite easy to image a few real-world scenarios where a possibility to retrieve this data in a large amounts very quickly is very important. Below we reveal some latent restrictions (concerning both performance, volumes and type of data to be processed) that do not allow our development team to use Matlab Database Toolbox in such scenarios. An alternative solution, PgMex library, was developed by our team to overcome these restrictions and to allow us to efficiently solve financial data processing problems. [Read More]

Performance comparison of PostgreSQL connectors in Matlab, Part I: inserting data

We actively develop software related to financial modelling and risk estimation. Most of model prototypes basing on data mining, machine learning, quantitative analysis we develop as well as certain parts of production code (thanks for JIT compilation and rich visualization capabilities) are implemented in Matlab. And naturally we always face the need to process huge amounts of financial data. Data processing usually generates even more data that needs to be stored somewhere in a persistent and consistent manner. There are many ways to achieve that, but for us the most reasonable choice is to use a relational database server. [Read More]