Re: CRecordSet and Table Indexes

From: Tim (Tim_at_NoSpam)
Date: 05/23/04


Date: Sun, 23 May 2004 13:43:59 +1200

Steve,

Firstly, a table can have many indexes...

It Depends. If the DBMS is SQL Server or one of the later versions of MS
Access then you can use an INFORMATION_SCHEMA view (See SQL Server books
online).

If you are wishing to obtain schema information then the above views are the
right things to use.

If you are wanting to identify what index you are 'using' then outside of
DAO there is 'no such thing' since the DBMS will use whatever indexes it
feels are appropriate for the queries your submit - IE it is dependant on
the DBMS version, the presence of indexes, the layout of your query
(somewhat, particularly early versions of SQL Server), the types of indexes
implicitly referred to (unique, non unique, clustered etc), the distribution
of data, data values supplied in WHERE and JOIN clauses and so on. With SQL
Server if you wish to tune your queries and see which indexes are used after
the fact, you can run the queries in Query Analyser (QA) using 'Show
Execution Plan'. QA is an excellent query tuning tool.

- Tim

"Steve" <anonymous@discussions.microsoft.com> wrote in message
news:463FF96F-975D-4188-B5CF-8037DC8ED61A@microsoft.com...
> How can I use CRecordSet to get the index name of a table? If not
> CRecordSet, what can I use? I need to capture the index name at runtime.



Relevant Pages

  • Re: Index Seek (or) Index Scan in Execution Plan
    ... your queries do run better when you use them. ... Run your query with and without the hint, ... SQL Server MVP ... >>>> It is preferable to not use index hints, ...
    (microsoft.public.sqlserver.server)
  • Re: Index Seek (or) Index Scan in Execution Plan
    ... your queries do run better when you use them. ... Run your query with and without the hint, ... SQL Server MVP ... >>>> It is preferable to not use index hints, ...
    (microsoft.public.sqlserver.programming)
  • Re: Ongoing purging of active records causes deadlocks
    ... For a query like: ... plan for some of our queries and it looks like it sorts first, ... What is a possible alternative, though, is that the purge first performs: ... Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books ... ...
    (comp.databases.ms-sqlserver)
  • Re: Looking for a professional SQL programmer for a small job
    ... Pro SQL Server 2000 Database Design - ... I have two queries to build and while I know my way around SQL, ... >> One is a seach query that pull rental properties from a database based on ...
    (microsoft.public.sqlserver.programming)
  • Re: Index Seek (or) Index Scan in Execution Plan
    ... The 2 queries in your list are not the same. ... This is called selectivity - If a very small percentage of rows in the table ... will be returned then the query is very selective. ... Wayne Snyder, MCDBA, SQL Server MVP ...
    (microsoft.public.sqlserver.server)