Tristramg/mumoro

Merging SQL requests

Closed this issue · 1 comments

Actually, during bike stations states retrieval, the SQL request makes 3 jointures :
-From the view recent_bikes which contains idStation and most recent chrone (timestamp)
-From the bike_stats table which contains avBikes and avSlots
-From the bike_stations_info table which contains the name and the coordinates of each station.

Indexs has been added to both tables , the idea now is to replace the current view with one containing also avBikes and avSlots having for results for the final SQL querry only 2 joinutres instead of 3.

I wasn't capable to include avBikes and avSlots into the view. Potgresql asked me ton include both avBikes and avSlots into the "group by" section.

Corrected, removed view and placed a new table which include all necessery data, emptied and refilled every 5 minutes