You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request provides following SQL query: (I uncommented line №295 in queryset.py to get raw query)
Long SQL statement
SELECT"user".id AS id,
"user".created_at AS created_at,
"user".updated_at AS updated_at,
"user".name AS name,
"user".surname AS surname,
"user".photo_url AS photo_url,
"user".email AS email,
"user".phone_number AS phone_number,
"user".notifications_enabled AS notifications_enabled,
bu1a62_event_user.idAS bu1a62_id,
bu1a62_event_user.eventmodelAS bu1a62_eventmodel,
bu1a62_event_user.usermodelAS bu1a62_usermodel,
fz662c_event.idAS fz662c_id,
fz662c_event.created_atAS fz662c_created_at,
fz662c_event.updated_atAS fz662c_updated_at,
fz662c_event.creatorAS fz662c_creator,
fz662c_event.nameAS fz662c_name,
fz662c_event.descriptionAS fz662c_description,
fz662c_event.chat_urlAS fz662c_chat_url,
fz662c_event.sportAS fz662c_sport,
fz662c_event.start_timeAS fz662c_start_time,
fz662c_event.locationAS fz662c_location,
fz662c_event.max_participantsAS fz662c_max_participants,
djb468_event.idAS djb468_id,
djb468_event.created_atAS djb468_created_at,
djb468_event.updated_atAS djb468_updated_at,
djb468_event.creatorAS djb468_creator,
djb468_event.nameAS djb468_name,
djb468_event.descriptionAS djb468_description,
djb468_event.chat_urlAS djb468_chat_url,
djb468_event.sportAS djb468_sport,
djb468_event.start_timeAS djb468_start_time,
djb468_event.locationAS djb468_location,
djb468_event.max_participantsAS djb468_max_participants,
bqfbf8_user_sport.idAS bqfbf8_id,
bqfbf8_user_sport.sportmodelAS bqfbf8_sportmodel,
bqfbf8_user_sport.usermodelAS bqfbf8_usermodel,
vwcd96_sport.idAS vwcd96_id,
vwcd96_sport.created_atAS vwcd96_created_at,
vwcd96_sport.updated_atAS vwcd96_updated_at,
vwcd96_sport.nameAS vwcd96_name,
vwcd96_sport.emojiAS vwcd96_emoji,
ugc52b_firebase_token.idAS ugc52b_id,
ugc52b_firebase_token.created_atAS ugc52b_created_at,
ugc52b_firebase_token.updated_atAS ugc52b_updated_at,
ugc52b_firebase_token."user"AS ugc52b_user,
ugc52b_firebase_token.device_idAS ugc52b_device_id,
ugc52b_firebase_token.tokenAS ugc52b_token,
ugc52b_firebase_token.ios_app_versionAS ugc52b_ios_app_version
FROM"user"LEFT OUTER JOIN event_user AS bu1a62_event_user ONbu1a62_event_user.usermodel="user".id
LEFT OUTER JOIN event AS fz662c_event ONfz662c_event.id=bu1a62_event_user.eventmodelLEFT OUTER JOIN event AS djb468_event ONdjb468_event.creator="user".id
LEFT OUTER JOIN user_sport AS bqfbf8_user_sport ONbqfbf8_user_sport.usermodel="user".id
LEFT OUTER JOIN sport AS vwcd96_sport ONvwcd96_sport.id=bqfbf8_user_sport.sportmodelLEFT OUTER JOIN firebase_token AS ugc52b_firebase_token ONugc52b_firebase_token.user="user".id
WHERE"user".id ='auth0|65215cfdcc2577c97118e6a1'ORDER BY"user".id,
fz662c_event.id,
djb468_event.id,
vwcd96_sport.id,
ugc52b_firebase_token.id
When I execute this statement directly via SQL - it takes about 300ms, but when I call the function - it takes about 3-4 seconds to get the result.
I have only 24 rows in events table, 18 in event_user, 8 in sports and 7 in users.
Describe the bug
I have a query in my code that gets one user from the table with all related fields. It looks like that:
This request provides following SQL query: (I uncommented line №295 in
queryset.py
to get raw query)Long SQL statement
When I execute this statement directly via SQL - it takes about 300ms, but when I call the function - it takes about 3-4 seconds to get the result.
I have only 24 rows in
events
table, 18 inevent_user
, 8 insports
and 7 inusers
.UserModel.py
EventModel.py
SportModel.py
schema.sql
To Reproduce
get
request withselect_all()
Expected behavior
Request will take much less time than now
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: