#12165: Ability to use SQL functions in queries
---------------------------------------------------+------------------------
          Reporter:  premalshah                    |         Owner:  nobody     
    
            Status:  new                           |     Milestone:  1.2        
    
         Component:  Database layer (models, ORM)  |       Version:  1.0        
    
        Resolution:                                |      Keywords:  mysql 
functions
             Stage:  Design decision needed        |     Has_patch:  0          
    
        Needs_docs:  0                             |   Needs_tests:  0          
    
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by premalshah):

 We are using MySQL which does not support user defined data types unlike
 postgres. In postgres, you could define a user defined field and tell it
 to use postgress functions when data is saved/retrieved from the database.
 This is why the responsibility of compress/decompress falls on the query
 or the application. There are other applications too. The mysql datetime
 field uses 8 bytes while the timestamp field (which stored the time as a
 unix timestamp) uses 4 bytes. If you have a few million rows, there is
 definitely some savings. mysql has functions like FROM_TIMESTAMP and
 UNIX_TIMESTAMP which convert the timestamps back and forth. It would be
 powerful to use these functions in the queries while still  operating on
 datetime objects in the python application. Any thoughts?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12165#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to