CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • add name index to civicrm_currency?
Pages: [1]

Author Topic: add name index to civicrm_currency?  (Read 720 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
add name index to civicrm_currency?
July 14, 2011, 04:19:43 pm
I noticed devel reporting this as a slow query (when I run the pledge summary report) - perhaps we should add an index on name?

SELECT id, name FROM civicrm_currency ORDER BY name
« Last Edit: July 14, 2011, 05:00:24 pm by Eileen »
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: add name index to civicrm_currency?
July 15, 2011, 12:23:40 am
Why is this searching by name in the first place (there isn't anywhere you can type the currency, that's always selected from list we generate, isn't it?)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: add name index to civicrm_currency?
July 15, 2011, 02:06:33 pm

I suspect this is used by default to load the currencies into the pseudo-constant memory cache. Not sure why its called in the pledge summary report. Might be an extraneous call.

BUT adding an index on NAME might not be a bad idea :) since if we do want any details of the currecy (symbol?) we'll refer to the currency by its name (USD, SEK, EUR) etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: add name index to civicrm_currency?
July 15, 2011, 02:10:38 pm
The only think I can see that could be calling it is

                              array( 'title'     => ts('Pledge Amount'),
                                     'required'  => true,
                                     'type'      => CRM_Utils_Type::T_MONEY ),

So, if it's missing a call to  a pseudoconstant it's happening from somewhere more integral than Civi that the pledge report
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: add name index to civicrm_currency?
July 15, 2011, 02:29:57 pm
Actually I think that query only ran once so it might hae been the pseudoconstant call - it just came up as slow rather than repetitive (the repetitive ones are a bigger issue but it's probably worth adding the index - I'll log an issue)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • add name index to civicrm_currency?

This forum was archived on 2017-11-26.