I have this:
SELECT ...
FROM trade, entry
WHERE AGE( CURRENT_TIMESTAMP, posted ) <= '5 minutes'::TIMESPAN
AND trade.entryId = entry.entryId
That is, fetch all trades executed in the last 5 minutes.
This query seems to run pretty slowly when trade is filled. Putting
an index on trade ( posted ) doesn't seem to help any (the same query
plan is generated). Any suggestions?
-itai