[Fusionforge-general] [PATCH] I delete unique indexes, becausetheseindexes are never unique

Julien Heyman julien.heyman at atosorigin.com
Thu Apr 2 10:58:20 CEST 2009


No, I drop only, because we have always two index by table... the good, 
and the bad, so i drop only the bad

christian.bayle at orange-ftgroup.com a écrit :
> Re, 
>
> Et tu ne recrées pas les indexes ?
>
> Christian 
>  
>
>   
>> -----Message d'origine-----
>> De : Julien Heyman [mailto:julien.heyman at atosorigin.com] 
>> Envoyé : jeudi 2 avril 2009 10:37
>> À : BAYLE Christian RD-SG-GRE
>> Cc : fusionforge-general at lists.fusionforge.org; Roland Mas
>> Objet : Re: [Fusionforge-general] [PATCH] I delete unique 
>> indexes,becausetheseindexes are never unique
>>
>> Ok, so, Forget my first patch, and see the new patch.
>>
>> I don't modify sf-2.6-complete.sql. And I don't modify gforge.sql
>>
>> commit 2a26fe64c1ca03f84b58d012dae8e66aae6133a1
>> Author: Julien Heyman <julien.heyman at atosorigin.com>
>> Date:   Thu Apr 2 10:33:12 2009 +0200
>>
>>     DROP unique index which are never unique
>>
>> diff --git a/gforge/db/20090402-drop-index-stats.sql
>> b/gforge/db/20090402-drop-index-stats.sql
>> new file mode 100644
>> index 0000000..9399f5d
>> --- /dev/null
>> +++ b/gforge/db/20090402-drop-index-stats.sql
>> @@ -0,0 +1,22 @@
>> +--
>> +-- DROP INDEX to fixed bug in stats
>> +-- because the index is never unique
>> +--
>> +
>> +DROP INDEX statsaggsitebygrp_oid;
>> +
>> +DROP INDEX statsprojectmetric_oid;
>> +
>> +DROP INDEX statsagglogobygrp_oid;
>> +
>> +DROP INDEX statsprojectdevelop_oid;
>> +
>> +DROP INDEX statssubdpages_oid;
>> +
>> +DROP INDEX statscvsgrp_oid;
>> +
>> +DROP INDEX statsproject_oid;
>> +
>> +DROP INDEX statssite_oid;
>> +
>> +DROP INDEX statssitepgsbyday_oid;
>> diff --git a/gforge/deb-specific/db-upgrade.pl
>> b/gforge/deb-specific/db-upgrade.pl
>> index 83f5b5e..8f7c273 100644
>> --- a/gforge/deb-specific/db-upgrade.pl
>> +++ b/gforge/deb-specific/db-upgrade.pl
>> @@ -2801,6 +2801,24 @@ eval {
>>          $dbh->commit () ;
>>      }
>>  
>> +    $version = &get_db_version ;
>> +    $target = "4.6.99-6" ;
>> +    if (&is_lesser ($version, $target)) {
>> +      &debug ("DROP UNIQUE INDEX never UNIQUE") ;
>> +      &drop_index_if_exists ($dbh, "statsaggsitebygrp_oid") ;
>> +      &drop_index_if_exists ($dbh, "statsprojectmetric_oid") ;
>> +      &drop_index_if_exists ($dbh, "statsagglogobygrp_oid") ;
>> +      &drop_index_if_exists ($dbh, "statsprojectdevelop_oid") ;
>> +      &drop_index_if_exists ($dbh, "statssubdpages_oid") ;
>> +      &drop_index_if_exists ($dbh, "statscvsgrp_oid") ;
>> +      &drop_index_if_exists ($dbh, "statsproject_oid") ;
>> +      &drop_index_if_exists ($dbh, "statssite_oid") ;
>> +      &drop_index_if_exists ($dbh, "statssitepgsbyday_oid") ;
>> +      &update_db_version ($target) ;
>> +      &debug ("Committing.") ;
>> +      $dbh->commit () ;
>> +    }
>> +
>>      ########################### INSERT HERE 
>> #################################
>>  
>>      &debug ("It seems your database $action went well and smoothly. 
>> That's cool.") ;
>>
>>
>>
>> christian.bayle at orange-ftgroup.com a écrit :
>>     
>>> Re,
>>>
>>> It is date ordered in db directory, you then have to add 
>>>       
>> some lines in 
>>     
>>> db-upgrade.pl to take it in account As far as I understood the 
>>> db-upgrade.php is taking this in account automatically
>>>
>>> Christian
>>>
>>>   
>>>       
>>>> -----Message d'origine-----
>>>> De : Julien Heyman [mailto:julien.heyman at atosorigin.com]
>>>> Envoyé : mercredi 1 avril 2009 17:29
>>>> À : BAYLE Christian RD-SG-GRE
>>>> Cc : fusionforge-general at lists.fusionforge.org
>>>> Objet : Re: [Fusionforge-general] [PATCH] I delete unique 
>>>> indexes,becausethese indexes are never unique
>>>>
>>>>
>>>>
>>>> christian.bayle at orange-ftgroup.com a écrit :
>>>>     
>>>>         
>>>>> Hello
>>>>>
>>>>> I think you should modify sf-2.6-complete.sql (maybe just
>>>>>       
>>>>>           
>>>> remove the
>>>>     
>>>>         
>>>>> create index) but also add an extra sql that drop and
>>>>>       
>>>>>           
>>>> recreate index for installed instances.
>>>>     
>>>>         
>>>>>   
>>>>>       
>>>>>           
>>>> ok, and what is the name of this sql? Is there a rule to name it?
>>>>     
>>>>         
>>>>> I just wonder why this problem was not encountered before
>>>>>
>>>>> Christian
>>>>>  
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>>> -----Message d'origine-----
>>>>>> De : fusionforge-general-bounces at lists.fusionforge.org
>>>>>> [mailto:fusionforge-general-bounces at lists.fusionforge.org]
>>>>>>         
>>>>>>             
>>>> De la part
>>>>     
>>>>         
>>>>>> de Julien Heyman Envoyé : mercredi 1 avril 2009 10:07 À : 
>>>>>> fusionforge-general at lists.fusionforge.org; Alain Peyrat;
>>>>>>         
>>>>>>             
>>>> Roland Mas
>>>>     
>>>>         
>>>>>> Objet : Re: [Fusionforge-general] [PATCH] I delete unique 
>>>>>> indexes,because these indexes are never unique
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Yesterday, I 'd like to finish my patch. But we have .sql
>>>>>>         
>>>>>>             
>>>> everywhere.
>>>>     
>>>>         
>>>>>> In the first time, I patch sf-2.6-complete.sql in deb-spec. 
>>>>>> But I don't patch when database already exists.
>>>>>>
>>>>>> In directory db, the bug is not here, because, in the
>>>>>>         
>>>>>>             
>>>> gforge.sql, the
>>>>     
>>>>         
>>>>>> unique index take 3 field. CREATE UNIQUE INDEX 
>>>>>> "statsaggsitebygrp_oid"
>>>>>> on stats_agg_site_by_group(month,day, group_id). So it's ok.
>>>>>>
>>>>>> Roland, can I patch the deb-spec? and if yes, how can I 
>>>>>>             
>> do. I see 
>>     
>>>>>> update-db.pl, where you write a lot sql request to update
>>>>>>         
>>>>>>             
>>>> database. I
>>>>     
>>>>         
>>>>>> make it in? I keep my path in sf-2.6-complete.sql?
>>>>>>
>>>>>> Julien.
>>>>>>
>>>>>> Julien Heyman a écrit :
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>> When there is a DB change, can you add an SQL script AND
>>>>>>>           
>>>>>>>               
>>>> update the
>>>>     
>>>>         
>>>>>>> gforge.sql also ?
>>>>>>>
>>>>>>> I make it as soon as possible and after I commit that .
>>>>>>>
>>>>>>> Julien Heyman a écrit :
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>>> ---
>>>>>>>>  gforge/deb-specific/sf-2.6-complete.sql |    8 ++++----
>>>>>>>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/gforge/deb-specific/sf-2.6-complete.sql
>>>>>>>> b/gforge/deb-specific/sf-2.6-complete.sql
>>>>>>>> index 7d583ec..286d4f8 100644
>>>>>>>> --- a/gforge/deb-specific/sf-2.6-complete.sql
>>>>>>>> +++ b/gforge/deb-specific/sf-2.6-complete.sql
>>>>>>>> @@ -5441,7 +5441,7 @@ CREATE UNIQUE INDEX 
>>>>>>>> "frsdlfileagg_month_day_file" on "frs_dlstats_file_agg" usin
>>>>>>>>  -- Name: "statsaggsitebygrp_oid" Type: INDEX Owner: tperdue
>>>>>>>>  --
>>>>>>>>  
>>>>>>>> -CREATE UNIQUE INDEX "statsaggsitebygrp_oid" on
>>>>>>>> stats_agg_site_by_group(month,day) ;
>>>>>>>> +-- CREATE UNIQUE INDEX "statsaggsitebygrp_oid" on
>>>>>>>> stats_agg_site_by_group(month,day) ;
>>>>>>>>  -- using btree ( "oid" "oid_ops" );
>>>>>>>>  
>>>>>>>>  --
>>>>>>>> @@ -5458,7 +5458,7 @@ CREATE UNIQUE INDEX 
>>>>>>>> "statssitebygroup_month_day_grou" on "stats_agg_site_by_grou
>>>>>>>>  -- Name: "statsprojectmetric_oid" Type: INDEX Owner: tperdue
>>>>>>>>  --
>>>>>>>>  
>>>>>>>> -CREATE UNIQUE INDEX "statsprojectmetric_oid" on
>>>>>>>> stats_project_metric(month,day) ;
>>>>>>>> +-- CREATE UNIQUE INDEX "statsprojectmetric_oid" on
>>>>>>>> stats_project_metric(month,day) ;
>>>>>>>>  -- using btree ( "oid" "oid_ops" );
>>>>>>>>  
>>>>>>>>  --
>>>>>>>> @@ -5475,7 +5475,7 @@ CREATE UNIQUE INDEX 
>>>>>>>> "statsprojectmetric_month_day_gr" on "stats_project_metric"
>>>>>>>>  -- Name: "statsagglogobygrp_oid" Type: INDEX Owner: tperdue
>>>>>>>>  --
>>>>>>>>  
>>>>>>>> -CREATE UNIQUE INDEX "statsagglogobygrp_oid" on
>>>>>>>> stats_agg_logo_by_group(month,day) ;
>>>>>>>> +-- CREATE UNIQUE INDEX "statsagglogobygrp_oid" on
>>>>>>>> stats_agg_logo_by_group(month,day) ;
>>>>>>>>  -- using btree ( "oid" "oid_ops" );
>>>>>>>>  
>>>>>>>>  --
>>>>>>>> @@ -5526,7 +5526,7 @@ CREATE UNIQUE INDEX 
>>>>>>>> "statscvsgroup_month_day_group" on "stats_cvs_group" using b
>>>>>>>>  -- Name: "statsprojectdevelop_oid" Type: INDEX Owner: tperdue
>>>>>>>>  --
>>>>>>>>  
>>>>>>>> -CREATE UNIQUE INDEX "statsprojectdevelop_oid" on
>>>>>>>> stats_project_developers(month,day) ;
>>>>>>>> +-- CREATE UNIQUE INDEX "statsprojectdevelop_oid" on
>>>>>>>> stats_project_developers(month,day) ;
>>>>>>>>  -- using btree ( "oid" "oid_ops" );
>>>>>>>>  
>>>>>>>>  --
>>>>>>>>   
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>> --
>>>>>> Julien HEYMAN
>>>>>> Open Source Center - Atos Origin
>>>>>> www.portaildulibre.fr
>>>>>>
>>>>>> Les Miroirs - 18 avenue d'Alsace
>>>>>> 92926 Paris La Défense CEDEX
>>>>>> Tél : +33 01 55 91 20 00
>>>>>> www.atosorigin.com
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Fusionforge-general mailing list
>>>>>> Fusionforge-general at lists.fusionforge.org
>>>>>> http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionfo
>>>>>> rge-general
>>>>>>
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>   
>>>>>       
>>>>>           
>>>> --
>>>> Julien HEYMAN
>>>> Open Source Center - Atos Origin
>>>> www.portaildulibre.fr
>>>>
>>>> Les Miroirs - 18 avenue d'Alsace
>>>> 92926 Paris La Défense CEDEX
>>>> Tél : +33 01 55 91 20 00
>>>> www.atosorigin.com
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> --
>> Julien HEYMAN
>> Open Source Center - Atos Origin
>> www.portaildulibre.fr
>>
>> Les Miroirs - 18 avenue d'Alsace
>> 92926 Paris La Défense CEDEX
>> Tél : +33 01 55 91 20 00
>> www.atosorigin.com
>>
>>
>>     

-- 
Julien HEYMAN
Open Source Center - Atos Origin
www.portaildulibre.fr

Les Miroirs - 18 avenue d'Alsace
92926 Paris La Défense CEDEX
Tél : +33 01 55 91 20 00
www.atosorigin.com





More information about the Fusionforge-general mailing list