Overview¶
Epsio plugs into existing databases and constantly updates results for queries you define whenever the underlying data changes, without ever re-calculating the entire dataset. This approach allows Epsio to provide instant and always up-to-date results for complex queries while significantly reducing costs.
Epsio supports most SQL syntax, including most types of JOIN
s, CTE
s, subqueries, GROUP BY
, and more.
How does it work?¶
As an example, imagine a database table that contains the salaries of all employees within a company, and a complex query that calculates the sum of salaries by department:
As new data arrives or existing data is updated, the answer needs to change accordingly. While traditional databases need to rerun the entire query to do this, Epsio will only perform the minimum calculations needed - in this case, adding or subtracting the new salary from the relevant department:
As the above calculation is very efficient (compared to recalculating the entire query), this results in massively reduced query times, significant cost savings, and a highly scalable architecture.
Usage¶
To configure Epsio to incrementally maintain the results of a heavy query, call the create_view
function with the name and query parameters (note that all work with Epsio is done calling functions/selecting data from your existing database).
postgres=# CALL epsio.create_view('epsio_view',
'SELECT SUM(SALARY), d.name FROM employee_salaries e
JOIN deplartments d on e.department_id = d.id
GROUP BY d.name');
NOTICE: View created successfully
CALL
To retrieve the results, query the newly created Epsio view.
postgres=# SELECT * FROM epsio_view;
sum | name
-------------+-------------
76348540000 | Engineering
14689640000 | Marketing
64478860000 | Sales
(3 rows)
Time: 7.598 ms