Too much delay |
Hi;
I have a library where it sets flash data like this but for some reason it takes such a long time. This takes about 3 seconds! PHP Code: $CI->session->set_flashdata('no_group_cards', $CI->model_auth->no_group_cards($CI->session->userdata['logged_data']['member_id'])); The query is nice and optimized: EXPLAIN. What could it be? Thanks
Code: $CI->session->userdata['logged_data']['member_id'] As far as I know userdata is a method, a getter.
ivantcholakov is correct, $CI->session->userdata is a method not an array.
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
(01-15-2015, 05:37 AM)Hobbes Wrote: ivantcholakov is correct, $CI->session->userdata is a method not an array.Hi; Not sure what I am missing :p This part retrieves data from DB ( and later stores them in the session ): PHP Code: model_auth->no_group_cards($CI->session->userdata['logged_data']['member_id'])
Is just what Ivan and Hobbes said: $CI->session->userdata() is a method. And you think that userdata is an array.
I suppose that you should so something like this: PHP Code: $logged_data = $CI->session->userdata('logged_data'); Website: http://avenir.ro
The userdata() method ... fetches data from the $userdata property, it's not only a method.
Its most likely that
PHP Code: $CI->model_auth->no_group_cards Make a count as: PHP Code: $start=microtime(TRUE); Once you get the timing you will know if the problem is in the auth method and perhaps you may need to add some index (user_id ) or on the field you are using for your Select. Best VPS Hosting : Digital Ocean
(01-22-2015, 03:04 AM)sv3tli0 Wrote: Its most likely that Hey; Nah that's not it. That query works and takes fraction of a second. I use these methods all around the app. But the session created is HUGE.
Please check the user guide for the session library, and look at how they show how to retrieve session data, and how you are using it.
|
Welcome Guest, Not a member yet? Register Sign In |