Or is it not necessary to have that option on the related table field, as the primary table indexed field does that job?
And is it a necessity to have the related table field to be indexed if I need distinct values only on that field in case there's a referential integrity between the primary and the related table, and in case there isn't one?
Thanks a bunch.
4 2265
Or is it not necessary to have that option on the related table field, as the primary table indexed field does that job?
And is it a necessity to have the related table field to be indexed if I need distinct values only on that field in case there's a referential integrity between the primary and the related table, and in case there isn't one?
Thanks a bunch.
Maybe I've phrased my question in a not so clearl way.
I'll rephrase it:
There's a primarty tblCities with CityID primary key field, and a related tblCustomers with CityID related field.
Primary table: tblCities -> Related table: tblCustomers
Primary Key field: CityID -> Related matching field: CityID
Is tblCustomers.Ci tyId.Indexed Yes (Duplicates OK) setting required to speed up a search of a city in a customers table?
MMcCarthy 14,534
Recognized Expert Moderator MVP
Maybe I've phrased my question in a not so clearl way.
I'll rephrase it:
There's a primarty tblCities with CityID primary key field, and a related tblCustomers with CityID related field.
Primary table: tblCities -> Related table: tblCustomers
Primary Key field: CityID -> Related matching field: CityID
Is tblCustomers.Ci tyId.Indexed Yes (Duplicates OK) setting required to speed up a search of a city in a customers table?
The short answer is yes. Also as it is involved in a relationship it should be indexed.
Indexing speeds up searches on the fields they are defined on, however too many indexes can also slow down the database.
The short answer is yes. Also as it is involved in a relationship it should be indexed.
Indexing speeds up searches on the fields they are defined on, however too many indexes can also slow down the database.
Thanks for your reply.
NeoPa 32,579
Recognized Expert Moderator MVP
Indices (Indexes) will normally speed up access to tables when the data is required (for any of a multitude of reasons - including sort order; linking; UNION conjoining; etc) in that order. This speed increase can be very significant, especially on large datasets. The downside of this is that time is taken to maintain the indices whenever a change is made to data in the fields involved (Adding a new record always involves updating all the indices). Although there is a balance to be struck, it is usually true to say that adding an index is beneficial if it's likely to be used.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Matt Liverance |
last post by:
I REALLY dont want to switch to oracle :( but I cant get these tables
working any faster.
I've got 2 dedicated servers, each with a slave, all run 32gig 15k rpm
raid 5 on u320 perc raid cards, dell 2600/4600's with single channel
backplanes (new ones will have dual channel)
All have 2 gig of ram, but I've never seen mysql use more than 300mb
of ram.
|
by: Jay |
last post by:
Hi I have a huge table with over 100million records and on regular
basis ineed to delete nearly a million records and insert a million
records.
Currently I delete indexes before going through the process and
recreate the indexes which takes a very very long time.
IS there a way to disable indexes and re enable them after doing
insert and delete by reindexing or anything of that sort?
OR
Is there an approach to append two tables with...
|
by: imani_technology_spam |
last post by:
We were trying to remove duplicates and came up with two solutions.
One solution is similar to the one found in a book called "Advanced
Transact-SQL for SQL Server 2000" by Ben-Gan & Moreau. This solution
uses temp tables for removing duplicates. A co-worker created a
different solution that also removes duplicates, but the other solution
uses subqueries instead of temp tables.
Theorhetically, which solution would result in faster...
|
by: Mats Kling |
last post by:
Hi all,
We are logging approx. 3 million records every day into a history
table.
Last week we ran into the 64 GB limit in UDB 8 so we recreated the
table with 8 k pagesize to get some breathingroom before we hit the
128 GB limit.
We are considering partitioning and I just wanted to check with you
that our proposal is the best one:
|
by: DH |
last post by:
I have a VERY basic question about figuring database size. I've inherited a
database which is generally similar to this basic one:
Item, Red, Blue, Green, Yellow
(text), (int),(int),(int),(int)
box, 1,0,0,2
hat, 0,0,0,1
car, 3,0,0,0
This format leads to a lot of zeros in the rows which take up a lot of
| |
by: vibha vyas |
last post by:
Hello sir
We have a very huge database its around 6 lakh records
are being stored in it.
records are not being a sorted order so we checked all
record field through clustering option in Sql server.when we used
clustering records are showing in sorted order but speed of database is
very slow .
i want to know with clustering is there any implecation in database
regading performance od data.Can any one give his views to solve this...
|
by: pcosway |
last post by:
(originally posted in database.myodbc by mistake)
I'm trying to speed up a fulltext search (MySQL 5.0.21, table has
670,000 records, about 900MBytes, machine has 1GB memory).
Fulltext search speed is quite variable -- sometimes really fast,
sometimes quite slow, so I'm trying to identify ways to make it more
consistent.
|
by: HLCruz via AccessMonster.com |
last post by:
I am working with a database that has client information separated in to 4
related tables - tFolder, tAddress, tEmail, tPhone number. In addition there
are related tables tGifts and tCalls. The database has roughly 22,000
records but should only have around 6,000. The remaining records are
duplicates, but in many cases the correct data for one person is spread out
between the duplicate records and related tables. I need to be able to...
|
by: jrod11 |
last post by:
hi,
I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums there are, it crashes.
There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)?
Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html
Here is some jquery js that I think...
|
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,...
|
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,...
| |
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
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...
| |