Question: ```
select s.name,c.name,r.edition,r.grade
from students s, courses c, registrations r
where s.student_id=r.student_id
and r.course_id=c.course_id
and r.grade > 10
order by 1,2,3;

```

Creating and index in "grade" column will improve this query performance?

Answer: 
The class name is already a namespace, so there's no reason to give the impl such a long name:

```
class LongDescriptiveClassName
{
public:
    // Stuff...

private:
    struct Impl;

    // shared_ptr is also an option if that's
    // the semantics you want.    
    std::unique_ptr<Impl> Data;
};

// and off in the implementation, we have...
struct LongDescriptiveClassName::Impl
{
    void PrivateMethod1();
    void PrivateMethod2();
    // and so on...
};

void LongDescriptiveClassName::Impl::PrivateMethod1()
{
    // Stuff...
}

```

It works just fine.

Incidentally, your code is not an example of the pimpl idiom. The "p" in "pimpl" means "pointer", and this is important. A reference means that the object does not own its implementation.

It's not necessarily wrong; there are sometimes good reasons to wrap a reference in a class, but it's not the pimpl idiom.
I'm not completely sure to understand your problem but it seems that a proper use of the `using` keyword should help a lot. Isn't

```
using ShortName = LongDescriptiveClassName::LongDescriptiveClassNameData

```

what you are looking for ?

Note this only work is `LongDescriptiveClassNameData` is a type not a data.