Java, JDBC, PostgreSQL, complex OLAP/BI queries