OK< I must say I don't think much of this filter if it couldn't tell
it was a relevant question.  After all, there's a select statement in
it!!  Anyway, any help or comments appreciated.  Since initially
sending this, I've learned why my predecesser did it this way -- eight
hours later, and it's still working on the output -- much too long.
Previously it would take about three hours to write the unsorted file
out and then unix's sort another hour or two.  But the unix sort is
breaking on it at the moment (I suspect due to the current size of the
output).  So to add to this question, is there some way of optimizing
this?

------- Forwarded Message

Date:    Sun, 23 Jun 2002 10:20:22 +0200
From:    [EMAIL PROTECTED]
To:      Cindy <[EMAIL PROTECTED]>
Subject: Re: sorting output 

Your message cannot be posted because it appears to be either spam or
simply off topic to our filter. To bypass the filter you must include
one of the following words in your message:

sql,query

If you just reply to this message, and include the entire text of it in the
reply, your reply will go through. However, you should
first review the text of the message to make sure it has something to do
with MySQL. Just typing the word MySQL once will be sufficient, for example.

You have written the following:


I've taken over a project put together by someone else.
This person did a lot of very weird things :-) and I'm 
thinking I can save myself some work.

First, he created a file as follows

select b.id, a.aid, a.wid, a.start, a.length
        into outfile 'newindex.txt'
        from wordindex a, wordforms b
        where a.wordform = b.wordform;

It looks roughly like this:

370210  1       1       155     11
917880  1       1       168     7
1259959 1       1       178     8
789078  1       1       188     4
735168  1       1       194     4
499918  1       1       200     8
...

Then he sorted it out, basically by sorting the first field, then within
that sort, by the second, then the third, and then the fourth (if I'm
reading the sort man page correctly):

/usr/xpg4/bin/sort -n -o newindex1.txt -k 1,1 -k 2,2 -k 3,3 -k 4,4 newindex.txt

My question is this: can't I just output the darned thing already sorted?
With something like:

select b.id, a.aid, a.wid, a.start, a.length
        into outfile 'newindex.txt'
        from wordindex a, wordforms b
        where a.wordform = b.wordform
        order by b.id, a.id, a.wid, a.start;

or are there arcane restrictions on a select that is output to a file?
But anyway, seems to me I've already got the ability to sort this silly
thing out beforehand and so eliminating a step.

Thanks,
- --Cindy
- -- 
[EMAIL PROTECTED]


------- End of Forwarded Message


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to