When we failed-over to a new machine one of our clients' searches began timing out, and we're trying to understand the behavior.
This search times out:
select count(*) from article where body not like 'hsbc' and content_id in ('ap.international','ap.top_news');
But reversing the clauses makes it work fine:
select count(*) from article where content_id in ('ap.international','ap.top_news') and body not like 'hsbc';
There is a metamorph inverted index bcc_vidx on (body, content_id)
and a regular index on content_id.
tsql -V shows the first (bad, timeout) search reading from the metamorph index:
200 Looking for index on article (body)
200 Opening index /p/data/texis/fulltext/bcc_vidx in the function ixfmmindex
and then apparently scanning the entire table(?)
and the second (good) search reading the content_id index first, and then the metamorph index.
200 Looking for index on article (content_id)
200 Opening index /p/data/texis/fulltext/content_id_idx in the function ixbteqindex
...
200 Comparing records
200 Looking for index on article (body)
200 Opening index /p/data/texis/fulltext/bcc_vidx in the function ixfmmindex
9
The search that is timing out now was working fine on the old machine which had an identical setup, though we can't examine the machine as the hardware is still kaput.
We can get good behavior by switching the clauses, but I'd like to have a better understanding of what's going on.
Can you help shed any light on this?
This search times out:
select count(*) from article where body not like 'hsbc' and content_id in ('ap.international','ap.top_news');
But reversing the clauses makes it work fine:
select count(*) from article where content_id in ('ap.international','ap.top_news') and body not like 'hsbc';
There is a metamorph inverted index bcc_vidx on (body, content_id)
and a regular index on content_id.
tsql -V shows the first (bad, timeout) search reading from the metamorph index:
200 Looking for index on article (body)
200 Opening index /p/data/texis/fulltext/bcc_vidx in the function ixfmmindex
and then apparently scanning the entire table(?)
and the second (good) search reading the content_id index first, and then the metamorph index.
200 Looking for index on article (content_id)
200 Opening index /p/data/texis/fulltext/content_id_idx in the function ixbteqindex
...
200 Comparing records
200 Looking for index on article (body)
200 Opening index /p/data/texis/fulltext/bcc_vidx in the function ixfmmindex
9
The search that is timing out now was working fine on the old machine which had an identical setup, though we can't examine the machine as the hardware is still kaput.
We can get good behavior by switching the clauses, but I'd like to have a better understanding of what's going on.
Can you help shed any light on this?