Subject | query slow response |
---|---|
Author | zifnabbe |
Post date | 2002-02-01T12:26:42Z |
Hi,
I've a table with all zipcodes and the name of the place. (primary
key on zipcode)
I've a persons table which contains the a field with the zipcode.
(foreign key on zipcode)
I've a view which joins both tables. This works fine. -> VIEW_PERSONS
Now, I've another table which contains appointments of the persons.
(which has field of personid)
(contains foreign key to personId)
I've a view which joins the appointments with the persons table. This
works fine.
But, I want to have the citynames as well. So I made a join of the
appointments with the VIEW_Persons view. This takes ages... I guess
it's normal that it takes longer, but this takes more than 10
minutes, while the join with the Persons table takes a few seconds...
What am I doing wrong? Database design? More indexes?
I've a table with all zipcodes and the name of the place. (primary
key on zipcode)
I've a persons table which contains the a field with the zipcode.
(foreign key on zipcode)
I've a view which joins both tables. This works fine. -> VIEW_PERSONS
Now, I've another table which contains appointments of the persons.
(which has field of personid)
(contains foreign key to personId)
I've a view which joins the appointments with the persons table. This
works fine.
But, I want to have the citynames as well. So I made a join of the
appointments with the VIEW_Persons view. This takes ages... I guess
it's normal that it takes longer, but this takes more than 10
minutes, while the join with the Persons table takes a few seconds...
What am I doing wrong? Database design? More indexes?