Re: Search by index vs. sequential scan
Posted in 2003
Topics: Performance & Tuning, Server Administration
Quoting "Mark D. Stock" <mdstock@MydasSolutions.com>:
> Robin Munn wrote:
> > Mark D. Stock <mdstock@mydassolutions.com> wrote:
> >
> > Thanks also for the environment variables suggestion. Do you mean
> > something like this?
> >
> > bash$ OPTCOMPIND=2 cat batch_query.sql | dbaccess
>
> Yes. Don't forget to export it though, dbaccess recognises the .sql
> suffix, and what's that cat for?:
>
> OPTCOMPIND=2 export OPTCOMPIND; dbaccess - batch_query; unset OPTCOMPIND
erm the form
bash$ OPTCOMPIND=2 somecommand
is the correct syntax to apply that environment variable for just one command
no export required
I think it applies to all variants of 'sh'. i.e. not csh and it's derivatives
--
Clive Eisen
mob: +44 (0) 7957 626 324
email: clive@serendipita.com internet: http://www.serendipita.com
Clive Eisen wrote:
> Quoting "Mark D. Stock" <mdstock@MydasSolutions.com>:
>>Robin Munn wrote:
>>>Do you mean something like this?
>>>
>>> bash$ OPTCOMPIND=2 cat batch_query.sql | dbaccess
>>
>>Yes. Don't forget to export it though, dbaccess recognises the .sql
>>suffix, and what's that cat for?:
>>
>>OPTCOMPIND=2 export OPTCOMPIND; dbaccess - batch_query; unset OPTCOMPIND
>
> erm the form
>
> bash$ OPTCOMPIND=2 somecommand
>
> is the correct syntax to apply that environment variable for just one command
> no export required
Correct, but the one command it applies to is 'cat' and the one
command that needs it is 'dbaccess'.
> I think it applies to all variants of 'sh'. i.e. not csh and it's derivatives
Yes, all its derivatives and not C Shells - one of the many reasons
for not using the C Shell except on the C Shore.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Jonathan Leffler <jleffler@earthlink.net> wrote:
> Clive Eisen wrote:
>> Quoting "Mark D. Stock" <mdstock@MydasSolutions.com>:
>>>Robin Munn wrote:
>>>>Do you mean something like this?
>>>>
>>>> bash$ OPTCOMPIND=2 cat batch_query.sql | dbaccess
>>>
>>>Yes. Don't forget to export it though, dbaccess recognises the .sql
>>>suffix, and what's that cat for?:
>>>
>>>OPTCOMPIND=2 export OPTCOMPIND; dbaccess - batch_query; unset OPTCOMPIND
>>
>> erm the form
>>
>> bash$ OPTCOMPIND=2 somecommand
>>
>> is the correct syntax to apply that environment variable for just one command
>> no export required
>
>
> Correct, but the one command it applies to is 'cat' and the one
> command that needs it is 'dbaccess'.
Whaddaya know, you're right! Serves me right for not double-checking my
command at the shell first. I'd forgotten that OPTION=value applies only
to the first command in a pipe. And I'd gotten used to piping SQL into
dbaccess's stdin, but here the "dbaccess - queryfile" format is
obviously better. So:
bash$ OPTCOMPIND=2 dbaccess - batch_query.sql
(I much prefer specifying extensions explicitly.)
>
>> I think it applies to all variants of 'sh'. i.e. not csh and it's derivatives
>
>
> Yes, all its derivatives and not C Shells - one of the many reasons
> for not using the C Shell except on the C Shore.
For more reasons, incidentally, read "Csh Programming Considered Harmful":
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
Thanks to everyone who helped!
--
Robin Munn <rmunn@pobox.com>
http://www.rmunn.com/
PGP key ID: 0x6AFB6838 50FF 2478 CFFB 081A 8338 54F7 845D ACFD 6AFB 6838