0

the table being queried has billions of records and the select query's where clause is based on non-indexed columns. So a normal select query does a full table scan & hence takes more time. I am trying to use parallel feature to see if it helps improving time. But wanted to know , if parallel will really help for Select queries on a single table with where clause on non-indexed columns ?

Example :

Select /*parallel(customer_data,4)*/ customer_id,name from customer_data where time_create >= :<min_time> AND customer_status='P'
skpraveen
  • 183
  • 1
  • 5
  • 18
  • You might want to add what type of RDBMS you are using, and also on how you plan to 'force' the system to use a parallel approach. – deroby Jun 02 '16 at 12:02

1 Answers1

0

In general, adding parallelism to a query that is a full table scan will help. However there are always things to take into account.

  1. Your example shows a comment, not a hint - you are missing the + (plus) sign, so parallelism will not be applied. You should have

    select /*+ parallel( customer_data, 4 ) */ customer_id, name...

  2. How many rows will be retrieved from your table? The answer to this question is not about where you can use parallelism, but more about whether you should

  3. How many CPU cores does the database server have and how much IO bandwidth does the storage provide? Parallelism (by design) can consume a large amount of resource; and often the amount of IO bandwidth available is not enough to support a high degree of parallelism. A very rough rule of thumb, is that each CPU core can consume between 50 MB/s and 200 MB/s
BobC
  • 4,208
  • 1
  • 12
  • 15