IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SQL Oracle Discussion :

Tuning Advisor : Erreur avec l'utilisation de Order by


Sujet :

SQL Oracle

  1. #1
    Membre régulier Avatar de Arvulis
    Profil pro
    Inscrit en
    Septembre 2003
    Messages
    117
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Septembre 2003
    Messages : 117
    Points : 73
    Points
    73
    Par défaut Tuning Advisor : Erreur avec l'utilisation de Order by
    Bonjour à tous,

    je suis en 10.2.0.3 sur du solaris 64bits et en faisant du tuning sur une requete, j'obtiens ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    - The optimizer could not merge the view at line ID 6 of the execution plan.
      The optimizer cannot merge a view that contains an "ORDER BY" clause unless
      the statement is a "DELETE" or an "UPDATE" and the parent query is the top
      most query in the statement.
    - The optimizer could not merge the view at line ID 4 of the execution plan.
      The optimizer cannot merge a view that contains "ROWNUM" pseudo column
    Avec une requete du style :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    SELECT numberofnewsbydomain (10, 'france', '1,2,3,4,5,6,7,8,9,11') AS ID, 
           NULL AS title, NULL AS summary, NULL AS published_on, 0 AS weight, 
           0 AS id_language, NULL AS code_language, 0 AS id_provider, 
           NULL AS code_provider, NULL AS updated_on 
      FROM DUAL 
    UNION --ALL 
    SELECT selectednews.ID AS ID, nn1.title AS title, nn1.summary AS summary, 
           nn1.published_on AS published_on, nn1.weight AS weight, 
           nn1.id_language AS id_language, 
           (SELECT ll.code 
              FROM mm_language ll 
             WHERE ll.ID = nn1.id_language) AS code_language, 
           nn1.id_provider AS id_provider, 
           (SELECT pp.code 
              FROM mm_newsprovider pp 
             WHERE pp.ID = nn1.id_provider) AS code_provider, 
           nn1.updated_on AS updated_on 
      FROM mm_newsitem nn1 
           JOIN 
           (SELECT a.* 
              FROM (SELECT /*+ FIRST_ROWS +*/ 
                           ROWNUM rnum, a.* 
                      FROM (SELECT   /*+ INDEX_COMBINE(NN) */ 
                                     nn.ID AS ID 
                                FROM mm_newsitem nn 
                               WHERE contains (nn.text_concat, '(usa)') > 0 
                                 AND nn.id_provider IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 11) 
                            ORDER BY nn.published_on DESC) a 
                     WHERE ROWNUM <= 1124) a 
             WHERE rnum >= 15 OR rnum <= 4) selectednews ON selectednews.ID = nn1.ID;

    Quelqu'un aurais t'il un avis ?

  2. #2
    Expert éminent sénior Avatar de mnitu
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Octobre 2007
    Messages
    5 611
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2007
    Messages : 5 611
    Points : 11 252
    Points
    11 252
    Par défaut
    Bref, il dit qui lui est impossible de faire le "view merging" à cause de la clause Order By or due à l’utilisation de la pseudo colonne RowNum
    13.4.1.1.1 View Merging
    Each view referenced in a query is expanded by the parser into a separate query block. The query block essentially represents the view definition, and therefore the result of a view. One option for the optimizer is to analyze the view query block separately and generate a view subplan. The optimizer then processes the rest of the query by using the view subplan in the generation of an overall query plan. This technique usually leads to a suboptimal query plan, because the view is optimized separately from rest of the query.

    The query transformer then removes the potentially suboptimal plan by merging the view query block into the query block that contains the view. Most types of views are merged. When a view is merged, the query block representing the view is merged into the containing query block. Generating a subplan is no longer necessary, because the view query block is eliminated.


Discussions similaires

  1. Réponses: 13
    Dernier message: 05/08/2008, 16h31
  2. Réponses: 3
    Dernier message: 26/06/2007, 12h50
  3. Erreur: avec l'utilisation de template<int N>
    Par vincho dans le forum C++
    Réponses: 8
    Dernier message: 22/02/2007, 19h07
  4. Erreur avec GetImageSize : utilisation d'une URL
    Par Are-no dans le forum Langage
    Réponses: 4
    Dernier message: 14/02/2007, 23h41
  5. Retour d'erreur avec l'utilisation de la commande For en VBS
    Par genialk2000 dans le forum VBScript
    Réponses: 3
    Dernier message: 30/03/2005, 18h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo