Hi, Markus -
If the current search process is able to wade its way through 280,000 rows with multiple OR conditions in only 15 seconds, you should be thrilled with that level of performance.
What's to keep the user from retrieving, then searching say, 500,000 or 1,000,000 rows (aside from running out of process memory, as Miguel mentioned)?
With this much data and a user that has no feel for their data, I think a different user interface design would be better. What if you provided a "search criteria" data input DataWindow in the upper portion of a window that is used to collect the user's search values (a value for each potential result set data column), then below that, a read-only grid that will display the results? The SELECT statement for the grid doesn't create a WHERE clause, so if the user retrieves without supplying any search criteria, they get all of the data (more on that soon). If the user supplies search criteria value(s), it's relatively easy to dynamically modify the grid DW's SELECT statement to append the appropriate WHERE clause conditions and then... the DBMS performs the search and only the rows that satisfy the search criteria are retrieved/displayed! Well-designed indexes in the database can significantly boost search/retrieval performance.
We've done this throughout our app and it works really well. The user can search for the desired value in column "A"... if no hits, they can try column "B", and so on, or any AND'ed combination of columns.
When there is the possibility that a large result set (10,000 rows or more, for example) will be retrieved, the window first builds a SELECT statement that does a "SELECT COUNT(*) FROM table1... WHERE search-criteria..." to see how many rows will be retrieved. This should be VERY efficient for the database to query. If that count comes back and it exceeds the "too large" threshold, the user gets prompted: "280,000 rows will be retrieved. Do you wish to continue? Yes/No/Cancel".
I realize this may sound overwhelming, but the code to implement all of this is pretty easy.
Nearly all databases can search efficiently, so this design allows it to do the searching. Large result sets can be aborted before the actual retrieve takes place, and only the data that matches the user's search criteria gets transmitted from the database to the app. The user can search to his/her/its heart's content with decent performance while avoiding the client-side searching of large result sets.
Maybe something to consider?
Regards, John