Filters VS SQL

Results 1 to 2 of 2

Thread: Filters VS SQL

  1. #1
    Jeremy Lowery Guest

    Default Filters VS SQL

    As far as performace is concerned, does any know if ADO Recordset filter properties are faster than SQL Select .... Where -> etc.. Of course, you can perform more complex queries with SQL. but for simple queries..

  2. #2
    Join Date
    Dec 1969

    Default RE: Filters VS SQL

    That&#039s a darned good question, which I&#039ve asked myself a number of times.<BR><BR>There isn&#039t a straightforward answer, because the perfomance of an operation like this depends largely on what you&#039re filtering. If all else were equal, I&#039d expect SQL Server to be able to do the job quicker because that&#039s what it&#039s designed for.<BR><BR>The sort of place where rs.filter is good is when you want to filter the results of an earlier query. For example, suppose I&#039ve got a set of 1000 records and I want to write a page that uses records that match criteria A and B, A and C, A and D. I can either write 3 separate SQL queries and execute these, or I can write a query for criteria A and then filter the result for B, C and D. If there are only 10 records that fulfil A then I&#039d expect that to be more efficient than issuing 3 separate command to the database. However, if 999 records fulfil A but only 1 each fulfils B, C and D then doing 3 queries might be better.<BR><BR>Do some prototyping - but remember to use operational-size datasets!<BR><BR>Disclaimer: note the use of the word *expect* repeatedly - I haven&#039t tested any of this...<BR><BR>Dunc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts