Subject Re: [ib-support] Re: Indices and views
Author Helen Borrie
At 12:54 PM 12-07-02 +0200, you wrote:
>Hi Helen,
>
> > Haha, someone else who appreciates my priorities. :-) The
> > first thing I do is assemble my bed. The next is to find
> > and start the coffee. The next is to set up one computer
> > for Internet access.
>
>I am a little bit disappointed - I thought the first step would
>be to set up your computer ;-)

No, I was awake for 32 hours, 5 of which I spent getting hypothermia in my
cold, empty house after driving 500 Km by starlight. The truck driver was
asleep in his vehicle at my gate when I arrived, with all of my stuff was
inside the vehicle. So sleep was the first priority, followed by coffee to
get me conscious, followed by a search of 8 rooms to find my carefully
labelled boxes of cables, followed by Internet connection. My office area
was full of boxes of clothes and dishes, also carefully labelled "Bedroom"
and "Kitchen" respectively.

> > I'm not up to score with your problem - but that message
> > seems to appear when you have conflicting indexes, or a
> > query which conflicts with the primary key. Do you, for
> > example, have an ORDER BY DESCENDING clause on
> > the PK column?
>
>There is only one ascending index on the PK. And no ORDER BY
>DESCENDING clause.
>
> > Or a multi-column join involving the PK column?
>
>Yes, the PK column is part of a join.
>
>I have provided a detailed table definition and the SQLs some
>mails before - if you want to and have the time <g>, you can
>have a look at it.

I found this:
/* View: V_BESCHR_PROJEKTE */
CREATE VIEW V_BESCHR_PROJEKTE(
JOBNAME,
JOBNR,
NUMMER,
[snip])
AS
SELECT
PROJOBNAME,
PROJOBNR,
NUMMER,
[snip]
FROM T_Projekte;

Have you performed a SELECT * on this view to observe the cardinality of
the rows? I suspect you will find they are ordered by JOBNAME. If so,
create another view, with NUMMER as the first column, then see whether your
plan will be permitted then...

I wonder why you are joining to a view here.

heLen

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________