1

Topic: Joining surveys on views

Hi all,

I had a big performance problem getting samples via the data service sorted by the survey title. After looking at the detail_samples view definition I changed the LEFT JOIN for the survey title with a JOIN, this boosted performance.
I think there is no reason to use a LEFT JOIN here, because a sample always belongs to a sample, or? If I right, can we change this, and also the view definition for the *_occurrences views?

Regards

Daniel

2

Re: Joining surveys on views

Hi Daniel
You are right, this should be an inner JOIN, but I note that the most recent copy of the detail_samples view issued by the upgrade scripts (in script 201404210905_groups_samples_views.sql) does have this as a JOIN not a LEFT JOIN. Has your warehouse been upgraded?
I've just added a script to remove the left join to surveys from the detail_occurrences view though, and will shortly copy that to the 0.9.1 branch.
Best wishes
John

John van Breda
Biodiverse IT