WITH behavior in relation to indexes I have a question related to behavior of WITH queries.

So I have 

WITH test as (
    SELECT id, name, ....
    FROM test...
    WHERE ... )


In that auxiliary statement I select a column(s) that have index on them. So question is - If i select later on from test will it use that index?
Short answer

No

Long Answer

The WITH clause, also known as CTE ( Common Table Expressions ) is evaluated first. If there are multiple CTE's the are evaluated in order of the appearance.

The resultset is kept in something like an "in memory temporary table" without any index on it.

Unless there is a very good reason, i would suggest to avoid CTE's as they are optimization fences ( for the query planner).