with about 8000 rows. For this table query:
SELECT MAX(MsgSeqNum),MAX(LogTimestamp) FROM ELT_tcli_MessageLog
WHERE LogTimestamp >= '0' AND IsFromCounterParty = 'Y' AND
IsOutOfSequence = 'N'
AND ConnectionName = 'DB_BENCHMARK'
AND LogTimestamp IN (SELECT MAX(LogTimestamp)
FROM ELT_tcli_MessageLog
WHERE MsgSeqNum > 0 AND IsFromCounterParty = 'Y'
AND IsOutOfSequence = 'N' AND
ConnectionName = 'DB_BENCHMARK')
takes about 1 second on MSSQL Server and 257 seconds on PostgreSQL one.
Does anybody have idea about reasons of such results?
1. Have you run vaccum analyze recently?
2. Reply with the output of EXPLAIN ANALYZE SELECT...
Chris
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings