Multiple queries from a single account vs multiple accounts

Database

Multiple queries from a single account vs multiple accounts

Hello,

 

I've encountered an issue when running multiple large queries from a single account.

 

In the past I’ve been running these queries from different accounts, but for convenience, I ran them all from a single account with much more spool space.

 

But I’m finding that these tasks are now taking significantly longer to complete than when I had them running from multiple accounts.

 

Does this sound familiar? If so, why does this happen?

 

Many Thanks

3 REPLIES
Teradata Employee

Re: Multiple queries from a single account vs multiple accounts

I assume you meaning running them concurrently.  If there are other users using the system at the same time, then by using multiple accounts you may be getting multiple time slices per second rather than just the one you get with a single user/account.

Re: Multiple queries from a single account vs multiple accounts

That's correct. For clarification, I tried running 8 instances of the same Matlab model at the same time (using the same Teradata account), but they all use different tables.

 

Could you explain to me what a 'time slice' is please?

Teradata Employee

Re: Multiple queries from a single account vs multiple accounts

Most computers today appear able to run multiple tasks at once, even more processes than there are CPUs or Cores. But that is an illusion - in principle only one thing can execute on a CPU at any one point in time.  Every multi-user operating system (and within that, every multi-user database system) has a Dispatcher that decides what task or process gets to run next on each CPU or core.  Via clock settings in the hardware, the dispatcher is awakened every few milliseconds (with some exceptions) to check the priority list of everything running and probably dispatch another task.  The currently executing process or task is interrupted to give another some time.  (This is where the term "mult-tasking" comes from.)  The code in any one program doesn't normally realize it has been interrupted because it will pick up where it left off when it is re-dispatched.  The period of time between dispatches is called a time slice.  The Teradata Workload Manager is used to dictate the priorities of workloads within Teradata - that is, how many time slices any one job or session gets over another.  When you run with multiple accounts you look like multiple jobs instead of just one, and each gets its share of time slices.