473,804 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A Basic Index Question

I have a table called EMPLOYEES with the following fields:
EmployeeID
LastName
FirstName
OtherData, etc...

In Table design:
I set EmployeeID as the primary index.
I created a MultiField index using LastName, FirstName and called it
idxLastFirst

I have a single bound form that that holds ALL the fields from my
table. It has the Record Source set to EMPLOYEES.
How do I bind the form to the idxLastFirst index I created, so that I
get the sort I want???
Do I have to create a Query? And, if so, what was the point of
creating the idxLastFirst index?

Thankyou

Dec 29 '06 #1
10 1554
Hi.
How do I bind the form to the idxLastFirst index I created, so that I
get the sort I want???
Do I have to create a Query?
If you want no flexibility on how the data is displayed, bind the form to the
table. In all other cases, create the query to display columns as desired and
the records in the order desired, then bind the form to that query.
Do I have to create a Query? And, if so, what was the point of
creating the idxLastFirst index?
To help Jet optimize the retrieval of records. And if the index is unique and
doesn't allow NULL's, it will prevent duplicate records in the table.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
<Ap******@gmail .comwrote in message
news:11******** *************@n 51g2000cwc.goog legroups.com...
>I have a table called EMPLOYEES with the following fields:
EmployeeID
LastName
FirstName
OtherData, etc...

In Table design:
I set EmployeeID as the primary index.
I created a MultiField index using LastName, FirstName and called it
idxLastFirst

I have a single bound form that that holds ALL the fields from my
table. It has the Record Source set to EMPLOYEES.
How do I bind the form to the idxLastFirst index I created, so that I
get the sort I want???
Do I have to create a Query? And, if so, what was the point of
creating the idxLastFirst index?

Thankyou

Dec 29 '06 #2
"Ap******@gmail .com" <Ap******@gmail .comwrote in
news:11******** *************@n 51g2000cwc.goog legroups.com:
I have a table called EMPLOYEES with the following fields:
EmployeeID
LastName
FirstName
OtherData, etc...

In Table design:
I set EmployeeID as the primary index.
I created a MultiField index using LastName, FirstName and
called it idxLastFirst

I have a single bound form that that holds ALL the fields from
my table. It has the Record Source set to EMPLOYEES.
How do I bind the form to the idxLastFirst index I created, so
that I get the sort I want???
Do I have to create a Query? And, if so, what was the point
of creating the idxLastFirst index?

Thankyou
Use the query. You created idxLastFirst so the query would run
much faster :-)

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Dec 29 '06 #3

Hi

I took your advice and built a query using the query builder:
SELECT [T-PERS].* FROM [T-PERS] ORDER BY [T-PERS].LAST, [T-PERS].FIRST;

It still makes no sense to me! Why build a multifield index
idxLastFirst at the table level and then do it again at the query
level. My record sort, for rec-to-rec viewing is based on the query
now, and has nothing to do with idxLastFirst which was originally
intended for this purpose??? Why even have it??? My key index is
EmpID for table cross linking.

Also, the SQL stmt created does not appear as though it defines a TRUE
multifield index???

Thanks for your comments
Greg

Dec 29 '06 #4
Ap******@gmail. com wrote:
Hi

I took your advice and built a query using the query builder:
SELECT [T-PERS].* FROM [T-PERS] ORDER BY [T-PERS].LAST,
[T-PERS].FIRST;

It still makes no sense to me! Why build a multifield index
idxLastFirst at the table level and then do it again at the query
level. My record sort, for rec-to-rec viewing is based on the query
now, and has nothing to do with idxLastFirst which was originally
intended for this purpose??? Why even have it??? My key index is
EmpID for table cross linking.

Also, the SQL stmt created does not appear as though it defines a TRUE
multifield index???

Thanks for your comments
Greg
You are not "building an index" when you apply a sort order in a query and you
are not establishing a sort order in a table when you create an index. These
are completely separate operations.

When you run your query and the query optimizer sees that you want a particular
sort order or are joining on a field or are applying criteria on a field it will
see if there are any indexes on those fields that will makes its job more
efficient. If it finds any such indexes it will use them thus making your query
faster than it would have been if the indexes did not exist.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 29 '06 #5
Thankyou for clarifying that Rick.
That having been said, I am on target with my approach for performance?

SELECT [T-PERS].* FROM [T-PERS] ORDER BY [T-PERS].LAST, [T-PERS].FIRST;

Will the above query perform better knowing that the index idxLastFirst
exists?

Do I need to make the query's ORDER BY somehow more specific?

ThankYou
Greg

Dec 29 '06 #6
Hi.
the SQL stmt created does not appear as though it defines a TRUE
multifield index???
To add to Rick's explanation, it appears that you were confusing the two
different operations. One may define a multicolumn index on a table using SQL,
but the syntax is very different than your SELECT query. It's called DDL (Data
Definition Language) SQL. For example:

CREATE INDEX IndexName
ON TableName (ColName1, ColName2);

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
<Ap******@gmail .comwrote in message
news:11******** *************@a 3g2000cwd.googl egroups.com...
>
Hi

I took your advice and built a query using the query builder:
SELECT [T-PERS].* FROM [T-PERS] ORDER BY [T-PERS].LAST, [T-PERS].FIRST;

It still makes no sense to me! Why build a multifield index
idxLastFirst at the table level and then do it again at the query
level. My record sort, for rec-to-rec viewing is based on the query
now, and has nothing to do with idxLastFirst which was originally
intended for this purpose??? Why even have it??? My key index is
EmpID for table cross linking.

Also, the SQL stmt created does not appear as though it defines a TRUE
multifield index???

Thanks for your comments
Greg

Dec 29 '06 #7
Ap******@gmail. com wrote:
Thankyou for clarifying that Rick.
That having been said, I am on target with my approach for
performance?

SELECT [T-PERS].* FROM [T-PERS] ORDER BY [T-PERS].LAST,
[T-PERS].FIRST;

Will the above query perform better knowing that the index
idxLastFirst exists?

Do I need to make the query's ORDER BY somehow more specific?
No. The optimizer should see the index and use it.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 29 '06 #8
"Ap******@gmail .com" <Ap******@gmail .comwrote in
news:11******** **************@ 48g2000cwx.goog legroups.com:
Thankyou for clarifying that Rick.
That having been said, I am on target with my approach for performance?

SELECT [T-PERS].* FROM [T-PERS] ORDER BY [T-PERS].LAST, [T-PERS].FIRST;

Will the above query perform better knowing that the index idxLastFirst
exists?

Do I need to make the query's ORDER BY somehow more specific?

ThankYou
Greg
No. Years ago MS bought FoxPro in order to get their Rushmore technology
which will optimize queries very well. So JET/Rushmore uses whatever
indexing it decides is most useful.

This is the plan JET uses to run a similar query:

--- Query3 ---

- Inputs to Query -
Table 'Employees'
Using index 'idxName'
Having Indexes:
idxName 9 entries, 1 page, 9 values
which has 2 columns, fixed
- End inputs to Query -

01) Scan table 'Employees'
Using index 'idxName'

--
lyle fairfield
Dec 30 '06 #9
Lyle Fairfield <ly***********@ aim.comwrote in
news:Xn******** *************** **********@216. 221.81.119:
No. Years ago MS bought FoxPro in order to get their Rushmore technology
which will optimize queries very well. So JET/Rushmore uses whatever
indexing it decides is most useful.
As an old fox (PRO user) I exaggerated Rushmore's role here. TTBOMK
Rushmore is called into play when one sets conditions that require the
instersection or union of sets of records, and optimizes performance by
performing the operations on pertinent indexes.

--
lyle fairfield
Dec 30 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1478
by: nick | last post by:
Hi, I'm pretty much a database beginner and have what I think is a basic question: If I have a table which has a 'status' column and I can have say three statuses: "active", "pending", "inactive". Is it better to break these out into a different "Statuses" table? On the one hand it seems to me it would be better to be in a different
5
5718
by: Lee David | last post by:
I went to the sun site and downloaded what I hope is the development part of java. I downloaded JDK5 with Netbeans. I installed it and now have a folder in my program group "Netbeans". Is that java? Would I execute that to create a java application? TIA, Lee
10
1871
by: Jason Curl | last post by:
Greetings, I have an array of 32 values. This makes it extremely fast to access elements in this array based on an index provided by a separate enum. This array is defined of type "unsigned long int". I have a typedef for this: typedef unsigned long int Uint32; typedef float Float32; Uint32 myArray;
4
2233
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time process? 2. What information contained in sn key. I gone through that it is having public key. How it is using this key to intract with client. 3. When we have to run gacutil.exe file. Whenever we
4
1782
by: Mark Fox | last post by:
Hello, I've noticed in some sample code that sometimes people use the @ before a string when concatenating them. Example: string filePath = Appl.Request.PhysicalApplicationPath + @"bin\" + asmname + ".dll"; Why is this done? What is the difference between using
3
2545
by: sefe dery | last post by:
hi ng, i try to create a asp.net 1.0 website on windows server 2003(Servername: ServerX) with iis 6.0. PROBLEM: The user should login with his windows credentials in basic.aspx and automatically redirect to his own files. i have the following file-structure:
21
1569
by: nateastle | last post by:
I have a simple assignment for school but am unsure where to go. The assignment is to read in a text file, split out the words and say which line each word appears in alphabetical order. I have the basic outline of the program done which is: def Xref(filename): try: fp = open(filename, "r") lines = fp.readlines() fp.close()
6
3148
by: Simon Walsh | last post by:
I'm an Electronics student in college and I'm currently working on a project. I was given a circuit diagram for my project, from which I had to design a printed circuit board to be sent off and manufactured. I got my printed circuit board back and populated it with components. On my circuit board, I have a chip holder for a Basic STAMP microcontroller. To those unfamiliar with it, the Basic STAMP is a microcontroller which has an onboard...
3
1946
by: Scott Stark | last post by:
Hello, I'm trying to get a better handle on OOP programming principles in VB.NET. Forgive me if this question is sort of basic, but here's what I want to do. I have a collection of Employee objects that I can iterate through relatively easily. I've included code at the bottom of this message. I can pretty easily iterate through my employee objects like so: Dim theEmployees As Employees = New Employees
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.