I'm not sure if this is an SQL Server bug or my mistake but here is the situation:
QUERY 1
select PK FROM PI_INFORM WHERE RECORD_DATE>DATEADD(hour,-48, GETDATE())
this takes less than 0.5 secs and returns 20,000 records
QUERY 2
SELECT PK FROM dbo.getInformFullTextPKs('"HELLO"')
this takes less than 1 secs and returns 500 records
PROBLEM If we join those two queries with INTERSECT, takes more than 3 minutes. Execution plans shows everything is performed using INDEX SEEK.
SELECT * FROM PI_INFORM WITH (NOLOCK)
WHERE PK IN (
select PK FROM PI_INFORM WHERE RECORD_DATE>DATEADD(hour,-48, GETDATE())
INTERSECT
SELECT PK FROM PI_INFORM WHERE PK IN (SELECT PK FROM dbo.getInformFullTextPKs('"HELLO"'))
)