Re: Is there any possible to prevent these additional quering "DESC users; DESC articles.... etc."

2006-08-28 Thread Fasthold

WOW! Thanks a lot to the all of the above! I'll enjoy my happy baking
regardless of the DESC stuff :)

Regards,

--FH


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Re: Is there any possible to prevent these additional quering "DESC users; DESC articles.... etc."

2006-08-28 Thread Samuel DeVore

Which is why when ever you update your database with new fields you
need to clear the various cache files or you  can get bit in the a$$
like I used to  ;)

Sam D

On 8/28/06, nate <[EMAIL PROTECTED]> wrote:
>
> When in debug mode, the cache of the model description expires every 20
> seconds or so.  However, when you switch to production mode (DEBUG = 0)
> the cache file stays active indefinitely (so the extra queries are not
> executed).
>
>
> >
>


-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is there any possible to prevent these additional quering "DESC users; DESC articles.... etc."

2006-08-28 Thread AD7six

Hi Fasthold,

Fasthold wrote:
> I only need the 7th 'SELECT' statement, but the other queries take much
> more loads of the server. I have tried the 'unbindModel()' method, but
> it seems useless.

If you are in debug mode queries are not cached for very long (a few
minute(s) I think) hence you will see DESC statements in your debug
window. If you refresh the page imediately you won´t see the DESC
statements, as it´s taken from the cache. if you are not running in
debug mode these desc statements are cached much longer (weeks).

> Is there any possible to cut these 'DESC' queries or prolong the cache
> period for performance purpose.

If you are debugging, you probably don´t want that - which is possibly
why cake caches the DESC for a short period of time. If you are not
debugging it´s not relavent, but you won´t see that because there
isn´t a sql debug window :)

But anyway: you can make your models persistent, which then means that
there are no DESC statements:
http://groups.google.com/group/cake-php/browse_frm/thread/d0e5e9cc7353ece/023dd55fddc5c3c4?lnk=gst&q=persistent+desc&rnum=1#023dd55fddc5c3c4

Cheers,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is there any possible to prevent these additional quering "DESC users; DESC articles.... etc."

2006-08-28 Thread nate

When in debug mode, the cache of the model description expires every 20
seconds or so.  However, when you switch to production mode (DEBUG = 0)
the cache file stays active indefinitely (so the extra queries are not
executed).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is there any possible to prevent these additional quering "DESC users; DESC articles.... etc."

2006-08-28 Thread Fasthold

Thanks for you reply.

My idea is that to specify the fields by hand and don't let cake to do
the describe query.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is there any possible to prevent these additional quering "DESC users; DESC articles.... etc."

2006-08-28 Thread Chris Hartjes

The DESC stuff is used by the model to allow you to use the magic DB
functions.  Without that introspection there is no way for your model
to automatically know the names of all the columns.

On 8/28/06, Fasthold <[EMAIL PROTECTED]> wrote:
>
> Hi, there
>
> This question has puzzled me for a long time.
>
> I found that as long as the cache expired(I hope I'm right:P), there
> are many addtional queries excuted like below:
>
> 1 DESC `users`  21 21 15
> 2 DESC `groups`  5 5 26
> 3 DESC `permissions`  4 4 32
> 4 DESC `articles`  10 10 28
> 5 DESC `categories`  6 6 29
> 6 DESC `votes`  12 12 34
> 7 SELECT `User`.`id`, `User`.`group_id`, `User`.`username`,
> `User`.`password`, `User`.`mobile`, `User`.`area`, `User`.`email`,
> `User`.`gender`, `User`.`photo`, `User`.`name`, `User`.`pid`,
> `User`.`description`, `User`.`created`, `User`.`modified`,
> `Group`.`id`, `Group`.`name`, `Group`.`isAdmin`, `Group`.`created`,
> `Group`.`modified` FROM `users` AS `User` LEFT JOIN `groups` AS `Group`
> ON `User`.`group_id` = `Group`.`id` WHERE (`User`.`id` = 135) LIMIT 1
> 1 1 16
>
> I only need the 7th 'SELECT' statement, but the other queries take much
> more loads of the server. I have tried the 'unbindModel()' method, but
> it seems useless.
>
> Is there any possible to cut these 'DESC' queries or prolong the cache
> period for performance purpose.
>
> Thanks!
>
> -- FH.
>
>
> >
>


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---