Re: Very slow query
- From: "Alain T." <thibault.alain@xxxxxxxxx>
- Date: Mon, 25 Dec 2006 14:12:54 -0500
Hi Tina!
Thanks for the information provided! And I thought I used the best
methodology to be efficient...
As I am not at all an Access expert, can you guide me a bit please, ie what
do the experts do instead?
Thank you!
Alain T.
"tina" <nospam@xxxxxxxxxxx> a écrit dans le message de news:
y9Bjh.269382$Fi1.238621@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sounds like you're using Lookup fields in your Main table. if so,
recommend
you get rid of them - see
http://home.att.net/~california.db/tips.html#aTip8
for more information. as you have already found out, using the Lookup
fields
obscures what data is actually being stored in the table - leaving you to
find out the hard way, when you export the data - and does nothing to
simplify writing a query to show the "display" data from secondary tables
rather than the stored data in the main table.
per Access 2003 Help, the number of enforced relationships allowed in a
query are "32 per table minus the number of indexes that are on the table
for fields or combinations of fields that are not involved in
relationships". unless you've indexed a number of non-linked fields,
you're
well under that limit (though the limit may change for different versions
of
Access; check Help in your version by searching on "specifications").
hth
"Alain T." <thibault.alain@xxxxxxxxx> wrote in message
news:%23cHIWM3JHHA.2140@xxxxxxxxxxxxxxxxxxxxxxx
Hi!table,
I built a Main table, normalized, containing about 800 records. It will
grow to about 1600-2000 records. 21 secondary tables (code, description)
are linked to the Main table. All the keys are indexed. On the Main
all secondary tables are link in the way showed in this sample :of
SELECT TB_Groupes_Age.Code, TB_Groupes_Age.Description FROM
TB_Groupes_Age
ORDER BY TB_Groupes_Age.Description;
When I display the content of the Main table, all the fields that contain
the foreign key display correctly the description instead of the code.
In the query, if I only chose the Main table, it is very fast. When I
run
that query in Access, the fields that contains the foreign keys display
correctly the information from the secondary tables (for example, instead
displaying the code 123, It would display "Emergency"). But if I get thethe
data in Excel, I get the code "123" instead of "Emergency", which is not
useful for people looking at the stats. To solve that problem, in the
query, I display the Main table and all the secondary tables so that all
data are also transfered in Excel. It works very fast if I use 15secondary
tables or less. More than that, big problem (after 90 minutes, it isstill
not finished...)!secondary
Below, you see a sample of the query with the main table and three
ones (the construction is the same, but just bigger, with all thesecondary
tables added) :
SELECT SCPU.Dte_Visite, SCPU.Période, TB_Accompagnements.Description,
TB_Centres_Référants.Description, TB_Dangerosités.Description
FROM TB_Dangerosités INNER JOIN (TB_Centres_Référants INNER JOIN
(TB_Accompagnements INNER JOIN SCPU ON TB_Accompagnements.Code =
SCPU.Accompagné) ON TB_Centres_Référants.Code = SCPU.Centre_Référant) ON
TB_Dangerosités.Code = SCPU.Dangerosité;
Is there a way to speed up the query?
Thanks a lot for any information provided.
Alain T.
.
- Follow-Ups:
- Re: Very slow query
- From: tina
- Re: Very slow query
- References:
- Very slow query
- From: Alain T.
- Re: Very slow query
- From: tina
- Very slow query
- Prev by Date: Re: basic counting problem
- Next by Date: Re: if table is null then incluse all record else only in table ...hel
- Previous by thread: Re: Very slow query
- Next by thread: Re: Very slow query
- Index(es):
Relevant Pages
|
Loading