Question about command processing...

3 views
Skip to first unread message

Gary

unread,
Aug 9, 2009, 12:54:30 PM8/9/09
to OpenQM-OpenSource
I read about the command processor and I have some understanding about
how it works, but I was wondering if anyone could answer a question...
From the command prompt ":", I execute "SELECT SHIPPER BY NUMBER".
When this finishes I get the "command in progress" prompt "::". If I
do ANOTHER "SELECT SHIPPER BY NUMBER" command from THIS prompt, what
is actually happening (it takes a LONG time)?

GaryW

Ashley Chapman

unread,
Aug 9, 2009, 1:18:08 PM8/9/09
to openqm-o...@googlegroups.com


2009/8/9 Gary <gwal...@gmail.com>

The double colon means that there is an active select list.  The subsequent SELECT command will first do the second select, then check that each record is also in the first select list (central portion of Venn diagram).  Finally, it then makes the new list active.  This all takes time, especially if the file is imbalanced (as you suspect).


 


GaryW





--
Ashley Chapman

Gary

unread,
Aug 9, 2009, 3:26:18 PM8/9/09
to OpenQM-OpenSource
So essentially it's an "AND" operation between the two selects and
(since the selects are not in any particular order) is probably
running in O(n squared) time.

GaryW

On Aug 9, 1:18 pm, Ashley Chapman <ash.chap...@gmail.com> wrote:
> 2009/8/9 Gary <gwalb...@gmail.com>

Ashley Chapman

unread,
Aug 9, 2009, 6:06:35 PM8/9/09
to openqm-o...@googlegroups.com


2009/8/9 Gary <gwal...@gmail.com>


So essentially it's an "AND" operation between the two selects

Yep, you've got it.   If you have several SELECTS, you can generally get best performance by combining them into one command, or by ordering the SELECTS so that the first one produces the smallest number of keys.  I.E. filter out as much as you can on the first command.  It all depends on your exact situation though.

It would be really nice to have the equivalent to Oracle's cost and rule based optimisers.  And some more index options too! 

I'm exhausted from a hectic weekend.  Off to bed!


Ashley Chapman

Gene Buckle

unread,
Aug 10, 2009, 9:26:19 AM8/10/09
to OpenQM-OpenSource
On Sun, 9 Aug 2009, Gary wrote:

>
> So essentially it's an "AND" operation between the two selects and
> (since the selects are not in any particular order) is probably
> running in O(n squared) time.
>

This feels wrong to me.

I know that in D3, when I perform a select and then select again from the
"waiting" prompt, it performs the new select checking only those items
that were found in the first select.

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://www.scarletdme.org - Get it _today_!

Ashley Chapman

unread,
Aug 10, 2009, 11:24:17 AM8/10/09
to openqm-o...@googlegroups.com


2009/8/10 Gene Buckle <ge...@deltasoft.com>


On Sun, 9 Aug 2009, Gary wrote:

>
> So essentially it's an "AND" operation between the two selects and
> (since the selects are not in any particular order) is probably
> running in O(n squared) time.
>

This feels wrong to me.

I know that in D3, when I perform a select and then select again from the
"waiting" prompt, it performs the new select checking only those items
that were found in the first select.


Yes, Gene.  I suspect that your version is more like what happens in QM/Scarlet.  In an attempt to explain what the double colon meant, I probably misled Gary.  Thanks for expressing it in a clearer fashion. :-)

The only excuse I offer is exhaustion from a knackering weekend!



--
Ashley Chapman

Gene Buckle

unread,
Aug 10, 2009, 11:48:38 AM8/10/09
to openqm-o...@googlegroups.com
On Mon, 10 Aug 2009, Ashley Chapman wrote:

> 2009/8/10 Gene Buckle <ge...@deltasoft.com>
>
>>
>> On Sun, 9 Aug 2009, Gary wrote:
>>
>>>
>>> So essentially it's an "AND" operation between the two selects and
>>> (since the selects are not in any particular order) is probably
>>> running in O(n squared) time.
>>>
>>
>> This feels wrong to me.
>>
>> I know that in D3, when I perform a select and then select again from the
>> "waiting" prompt, it performs the new select checking only those items
>> that were found in the first select.
>
>
> Yes, Gene. I suspect that your version is more like what happens in
> QM/Scarlet. In an attempt to explain what the double colon meant, I
> probably misled Gary. Thanks for expressing it in a clearer fashion. :-)
>

S'ok. I read the original and went "Arooo?"[*] :)

> The only excuse I offer is exhaustion from a knackering weekend!
>

In the wise vernacular of my neice, "Ur doin it rong!" :)

[*] A sound made by the main character of a USAian show called Tool Time.
whenever something didn't make sense. No longer on the air, but still
funny. :)

Reply all
Reply to author
Forward
0 new messages