• Previous message: [greg-dev] FOSS, Science, and Public activism
  • Next message: [greg-dev] query analysis, part 1
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    [greg-dev] query analysis, part 1

    Marco, et al.,
    
    I've been taking a look around... some of the SQL queries got my attention.
    
    1) These two are executed a lot, looks like on every page load.  What
    can you tell me about them?  Is it necessary to run these so
    frequently?  I imagine it's to do with PHP not being able to cache
    these, but I don't know for sure since I'm not a PHP guy.
      select key_,value_,default_,type_,desc_,export_  from  config
      select fk_ref_object_id, proptype, property, value from  properties
    
    Thoughts:
    MySQL's query cache can mitigate this.
    Many columns in these two tables are text, is this absolutely necessary?
    
    
    2) What in the world is this?  It is executed about half as much as #1
    and I have no idea why.  Plus, it does a full table scan.
      select id from  channels  where url='S'
    
    
    3) This computed value should be stored!  It performs a full table
    scan on item.  In my setup, that's 10,000 rows.
      select unix_timestamp(max(added)) as max_added from  item
    
    Thoughts:
    Store one master timestamp in another table and update it each time an
    item is added.  Then, just select that one timestamp.
    
    
    That's it for now, more to come.
    
    Posted by Mike Christianson [reply] at Wed Jul 5 09:35:29 CEST 2006