Hi all
I have a set up that works in development but not in production and it
all comes down to a query that is generated by rails.
[4;36;1mGreenRoom Load Including Associations (0.000000) [0m
[0;1mSELECT green_rooms.id
AS t0_r0, green_rooms.green_room
AS
t0_r1, green_rooms.team_level_id
AS t0_r2,
green_rooms.organizational_area_id
AS t0_r3, green_rooms.meeting
AS t0_r4, green_rooms.parent_id
AS t0_r5, green_rooms.created_by
AS t0_r6, green_rooms.created_at
AS t0_r7, green_rooms.updated_by
AS t0_r8, green_rooms.updated_at
AS t0_r9, green_rooms.comment
AS
t0_r10, green_rooms.lock_version
AS t0_r11,
organizational_areas.id
AS t1_r0,
organizational_areas.org_area_name
AS t1_r1, team_levels.id
AS
t2_r0, team_levels.level
AS t2_r1, parents_green_rooms.id
AS
t3_r0, parents_green_rooms.green_room
AS t3_r1,
parents_green_rooms.team_level_id
AS t3_r2,
parents_green_rooms.organizational_area_id
AS t3_r3,
parents_green_rooms.meeting
AS t3_r4,
parents_green_rooms.parent_id
AS t3_r5,
parents_green_rooms.created_by
AS t3_r6,
parents_green_rooms.created_at
AS t3_r7,
parents_green_rooms.updated_by
AS t3_r8,
parents_green_rooms.updated_at
AS t3_r9,
parents_green_rooms.comment
AS t3_r10,
parents_green_rooms.lock_version
AS t3_r11 FROM green_rooms LEFT
OUTER JOIN organizational_areas ON organizational_areas.id =
green_rooms.organizational_area_id LEFT OUTER JOIN team_levels ON
team_levels.id = green_rooms.team_level_id LEFT OUTER JOIN green_rooms
parents_green_rooms ON parents_green_rooms.id = green_rooms.parent_id
WHERE (green_rooms.parent_id = ‘4’) LIMIT 0, 15 [0m
^[[4;36;1mGreenRoom Load Including Associations (0.000872)^[[0m
^[[0;1mSELECT green_rooms.id
AS t0_r0, green_rooms.green_room
AS
t0_r1, green_rooms.team_level_id
AS t0_r2,
green_rooms.organizational_area_id
AS t0_r3, green_rooms.meeting
AS t0_r4, green_rooms.parent_id
AS t0_r5, green_rooms.created_by
AS t0_r6, green_rooms.created_at
AS t0_r7, green_rooms.updated_by
AS t0_r8, green_rooms.updated_at
AS t0_r9, green_rooms.comment
AS
t0_r10, green_rooms.lock_version
AS t0_r11,
organizational_areas.id
AS t1_r0,
organizational_areas.org_area_name
AS t1_r1, team_levels.id
AS
t2_r0, team_levels.level
AS t2_r1, childrens_green_rooms.id
AS
t3_r0, childrens_green_rooms.green_room
AS t3_r1,
childrens_green_rooms.team_level_id
AS t3_r2,
childrens_green_rooms.organizational_area_id
AS t3_r3,
childrens_green_rooms.meeting
AS t3_r4,
childrens_green_rooms.parent_id
AS t3_r5,
childrens_green_rooms.created_by
AS t3_r6,
childrens_green_rooms.created_at
AS t3_r7,
childrens_green_rooms.updated_by
AS t3_r8,
childrens_green_rooms.updated_at
AS t3_r9,
childrens_green_rooms.comment
AS t3_r10,
childrens_green_rooms.lock_version
AS t3_r11 FROM green_rooms LEFT
OUTER JOIN organizational_areas ON organizational_areas.id =
green_rooms.organizational_area_id LEFT OUTER JOIN team_levels ON
team_levels.id = green_rooms.team_level_id LEFT OUTER JOIN green_rooms
childrens_green_rooms ON childrens_green_rooms.parent_id =
green_rooms.id WHERE (green_rooms.id = ‘3’) AND green_rooms.id IN
(‘3’) ^[[0m
the first query is in development and the second is in production.
The major difference is parent being replace with children and it
looks at green_rooms from an eager loading query .
Any reason why this is happening or how to fix it will be
apprieciated.
White W.