db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oystein.Grov...@Sun.COM (Øystein Grøvlen)
Subject Re: Natural Sort Order
Date Mon, 01 Aug 2005 10:46:18 GMT
>>>>> "JR" == Justin Rudd <justin.rudd@gmail.com> writes:

    JR> SELECT id, enqueued_datetime, begin_dequeue_datetime, content FROM
    JR> messages WHERE release_datetime < ? and begin_dequeue_datetime = 0 FOR
    JR> UPDATE begin_dequeue_datetime

    JR> Where the first '?' in the select is the time which the query came in
    JR> (System.currentTimeMillis()).

    JR> It uses the IxMsgsRel index, but the ordering doesn't appear to use
    JR> that index.  The query log doesn't show me what it is using for
    JR> sortation.  I would have expected the sortation order to be
    JR> release_datetime and then enqueued_datetime.  It wouldn't be strict
    JR> fifo, but it would be close enough.

    JR> So how do I tell what Derby is using for sortation?

If you want a specific ordering, you should add an "ORDER BY" clause
to your statement.

-- 
Øystein


Mime
View raw message