Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Use SQL

by vitoco (Friar)
on Sep 04, 2009 at 13:55 UTC ( #793459=note: print w/ replies, xml ) Need Help??

in reply to Use SQL
in thread Combinatorics problem

Using SQL, you can't be sure that the resulting list will preserve the order of the original lists.

Unsorted original lists and the use of primary keys or clustered tables, the query optimizer, size of lists and blocking factor among others are things I can recall that might change the way the output is returned... :-(

Comment on Re: Use SQL
Replies are listed 'Best First'.
Re^2: Use SQL
by herveus (Parson) on Sep 08, 2009 at 11:07 UTC

    Actually, you can ensure the order of the output, but it requires that the base tables include a column with a sort key. Then you have something you can use in an order by clause.

    Fundamentally, generating the cartesian product of the input lists will generate the elements of the output list. Controlling the sequence is a minor additional task.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://793459]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2015-11-26 19:02 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (706 votes), past polls