I have many tables of the same length (number of rows) that where previously ordered by some columns as they were being written on disk.
My SELECT
is of the form:
SELECT t1.id, t1.value, t2.value, t3.value, ...
FROM t1 LEFT JOIN t2 ON t1.id=t2.id
LEFT JOIN t3 ON t1.id=t3.id
...
I know by how these tables were populated that this result corresponds exactly to simple column binding, so that ON t1.id=t2.id
and ON t1.id=t3.id
can be omitted. The problem is, as far as I know, RDBMSs can operate only projections and row binding. Column binding isn't a typical operation.
So the question is the following: is it possible to bind columns "as they are" without specifying any join criteria? For example, the following query, which is syntactically wrong, should explain what I mean:
SELECT t1.id, t1.value, t2.value, t3.value, ...
FROM t1 COLUMN_BIND t2 COLUMN_BIND t3
...
I'm using PostgreSQL 9.4.5.