Thread: "could not devise a query plan for the given query"

"could not devise a query plan for the given query"

From
"Greg Stark"
Date:
I'm trying to actually run the experiments Tom suggested running EXPLAIN on
the DBT3 DSS queries for various default_stats_target sizes. It's a bit of a
headache because DBT3 seems to be unmaintained these days so lots of things
don't really work.

I ran into an error I've never seen before:

ERROR:  XX000: could not devise a query plan for the given query
LOCATION:  set_cheapest, pathnode.c:191

I haven't tried to figure out what's going on yet.

The schema is attached and the query which triggers the error is:


    explain select
            s_name,
            count(*) as numwait
    from
            supplier,
            lineitem l1,
            orders,
            nation
    where
            s_suppkey = l1.l_suppkey
            and o_orderkey = l1.l_orderkey
            and o_orderstatus = 'F'
            and l1.l_receiptdate > l1.l_commitdate
            and exists (
                    select
                            *
                    from
                            lineitem l2
                    where
                            l2.l_orderkey = l1.l_orderkey
                            and l2.l_suppkey <> l1.l_suppkey
            )
            and not exists (
                    select
                            *
                    from
                            lineitem l3
                    where
                            l3.l_orderkey = l1.l_orderkey
                            and l3.l_suppkey <> l1.l_suppkey
                            and l3.l_receiptdate > l3.l_commitdate
            )
            and s_nationkey = n_nationkey
            and n_name = 'IRAQ'
    group by
            s_name
    order by
            numwait desc,
            s_name;


--
greg

Attachment

Re: "could not devise a query plan for the given query"

From
Tom Lane
Date:
"Greg Stark" <stark@enterprisedb.com> writes:
> I ran into an error I've never seen before:
> ERROR:  XX000: could not devise a query plan for the given query

That's cause I just recently broke it :-(

Fixed.
        regards, tom lane