Which is faster? (SQL)

Results 1 to 2 of 2

Thread: Which is faster? (SQL)

  1. #1
    Join Date
    Dec 1969

    Default Which is faster? (SQL)

    ASP/VBScript + MS Access Question...<BR><BR> Which is faster, selecting a value from a Query, or <BR>executing a SQL statement that will generate the value?<BR>Both use the same SQL statement...something like:<BR><BR>select top 1 id from someTable order by someEntity DESC;<BR><BR>If there is a speed difference, can someone explain why?<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default Probably no real difference...

    I presume that, in order to get the value from the query, you will end up using SQL such as<BR> Set RS = conn.Execute( "SELECT id FROM yourQuery" )<BR><BR>So any advantage there might be in using a stored query is largely negated by the fact that now the JET engine has to process *another* query to even get to the stored query.<BR><BR>Since Access/JET does *NOT* have a pre-compiler (as does SQL Server, for views and stored procs), at most there might be a minor boost from using the stored query within Access. But then the needed extra layer of SQL from ASP/ADO cancels out that boost.<BR><BR>But this is all a guess. If it&#039;s really important to you, why not run a few benchmark tests?<BR><BR>

Posting Permissions

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