Threaded Queries from Single static Connection object - Good approach?

Hi,
I need to generate a report where I need to query count(1) from over one hundred tables from oracle 10g database. I am not updating or deleting any record.
My approach is to use a single static connection object and create one thread for each table and capture the result back into a static hashtable.
But still, I am not getting any substantial performance improvement. Earlier, my report took 40 minutes, when it was non-threaded and now it takes 30 minutes.
Is there anything more I can do to make my report get the counts faster? Will a connection pool help?

Tolls wrote:
jschell wrote:
I was told by the DBA that count(1) works faster than count(*)....that's why....Unlikely. Certainly not true in current versions of Oracle if that is the source.Not unlikely, actually not true. Beneath the hood Oracle turns a count(1) into a count(*) in order to deal with this. Why? Because count(1) is turned into count(*) in order to avoid it being slower (Oracle 7 was the last time count(1) was different). And the reason generally given is because so many people were mistakenly using count(1) thinking it performed better that they decided to put in the "conversion" to fix the silly queries.
I think this it the [Ask Tom|http://asktom.oracle.com/pls/asktom/f?p=100:11:109792721681931::::P11_QUESTION_ID:1156159920245] link I used last time this came up here.
I knew all that, but I missed that the OP had specified the database vendor and version.

Similar Messages

  • Link from IS-U connection object to email from marketing campain

    Hi all,
    I've a problem with emails from marketing campains in WebUI.
    If you send an email from such a campain, it is linked at the contact historie of the receiving BP.
    But we need an additional link from the IS-U connection objects of this BP to this email.
    I implemented the badi CRM_MKT_MODIFY_ORDER to add the link in the docflow segment.
    but now there a two mistakes. from the contact history of the BP the link still starts BT126H_MAIL, but only the part "references" is filled with BP, contact, res.employee and header data of the marketing campain. The email block is empty although the mail was sent correctly. Why am I losing the reference to the the email/smartform?
    the second mistake is even more curious to me. in the contact history of the connection object is a link to the email created. But the link leads to component BT126H_APPT although its category is email.
    Any idea, what's my mistake?
    regards
    Martin
    Edited by: Martin Knittel on Aug 3, 2009 5:11 PM:
    I solved problem no 1. Forgot a partner dataset in the badi.
    But need still your help with problem no 2. Why is there a link to BT126H_APPT instead of BT126H_MAIL?

    Was a mistake in standard coding. Solved by sap note

  • Unassing a Premise froma Connection Object

    Hi ISU Experts!
    I juste wanted to ask you if it is possible to unassing a Premise from a Connection Object.
    A user created a new ConnObject/Premise/Installation, but when creating the Premise he assigned it to another Connection Object. Is it possible to reassing the premise? Or Unassign the Premise from the Actual Connection Object?
    Or the should create a new Premise/installation again?
    Thak you very much in advance,
    Best regards
    LUCAS

    Hi,
    There is no reversal process where you can reverse the assignment of a premise with connection object. You need to create a new set of these technical master data once more.
    You can set the 'Delete' flag available at connection object/premise/installation level. It will be archived from the system during archive run.
    Thanks.
    Nirmalya

  • Connection object creation

    Hello
    We are developing a website using the java technologies.
    We are not using the connection pooling for connecting to the database. We use a static connection object and calling it in all the pages.
    Is there any other good method for connecting to a database?

    Writing to memory purpose is storing memory
    Static connection should not use for data entry operation (if there is any common insert, update or delete statement exists). If any one of the client gives a commit cases all the database entries of the particular connection will be committed. In the case of display purpose static connection will not cause any problem.
    If u r requirement is for data entry then try to use one method.. Whenever user logged in create a unique id and create a connection for this particular user. Then store this connection as well as id in a static hashmap in servlet. This id should be attach in all the further requests for retrieving the connection..
    If anymore clarification needed
    Mail me
    [email protected]

  • How to store Connection object and call it from other programs.

    Hi,
    I am trying to connect to the database, store the connection object and use this connection object from other standalone java programs.
    Can any one tell me how to do this? I've tried in the following way:
    In the following program I am connecting to the database and saving the connection object in a variable.
    public class GetKT2Connection {
       public static void main(String[] args) {
          String url = "jdbc:odbc:SQLDsn;
          String dbUser = "sa";
          String dbPwd = "sa";
          Connection kt2conn = Connection connection = java.sql.DriverManager.getConnection(url, dbUser, dbPwd);
          if(kt2conn == null) {
             System.out.println("Database Connection Failure!");
          else {
             System.out.println("Connected to Database...");
         GetKTConnectionObj.storeKT2ConnectionObj(kt2conn);
    } Here is the program to save connection object in a variable.
    public class GetKTConnectionObj {
       static Connection kt2Connection = null;
       public static void storeKT2ConnectionObj(Connection conn) {
       kt2Connection = conn;
       public static Connection getKT2ConnectionObj() {
       try {
          return kt2Connection;
       catch(Exception e){
          System.out.println(e);
      return null;
    }Now from the following code I am trying to get the connection object that is stored. But this is throwing NullPointerException.
    public class Metrics_Migration {
      public static void main(String args[]) {
         try {
        java.sql.Connection connection_1 =   GetKTConnectionObj.getKT6ConnectionObj();
         catch(Exception e){
    }

    kt2Connection is null. You need to store it first, to make it not null. Otherwise it will stay null forever. And why on earth are you trying to do this THIS way?
    If you are running the two applications separately, it wont work either.

  • Connection object repliction from isu to crm

    Dear Experts,
    I want to replicate the connection object from ISU to CRM could you tell me what are the configuration steps to be maintain in the CRM sytem so that the connection objects replicates to CRM.
    Thanks & Regards
    Boyz.
    Moderator note:  thread locked - no research done, available in other threads.

    Hello,
    Please see note  632749 for help with this issue.
    Please also check the foloowing points:
    1.  Are there any contract account entries existing in the table 'TFK_BUAG_REF' (IS-U System).
    2.  Check the contract account entries in your IS-U system with the transaction 'CAA3'. Are they existing ?
    3.  The buag class entry in table 'TFK_BUAG_REF' (IS-U System) is corresponding to the buag class entry in your business agreement (CRM system).
    I hope this is helpful.
    Regards
    Olivia
    Edited by: Olivia Walsh on Jan 24, 2011 5:40 PM

  • Creating logical/virtual connection object  from physical connection

    Can anybody help me what is creating logical/virtual connection object and how to create it from physical connection in java ??
    Thanks in advance...

    WHile you are waiting for an answer, you might want to review the related Oracle documentation:
    For 10g, all docco is at http://www.oracle.com/pls/db102/portal.portal_db?selected=3 and docco I suspect will help you is "Java Developer's Guide" and "JDBC Developer's Guide and Reference"

  • Connection object from application module

    hi
    i was wondering if there is someway to retrieve the Connection object from the application module. something like:
    java.sql.Connection conn = appMod.getConn();
    i'm using JDeveloper 9.0.3.4
    Thanks in advanced
    Vitor

    Take a look at
    http://radio.weblogs.com/0118231/2004/01/30.html#a232
    Sascha

  • Obteain connection object from application module

    Hello
    I am working with ADF 10g using BC4j , I am in application module implementation class, how can I obtain the java.sql.connection object used by my application module?

    to execute prepared statements follow
    http://download-uk.oracle.com/docs/html/B25947_01/bcadvgen005.htm#sm0297
    to access the SQL connection itself (for whatever reason)
    Re: how to get connection from adf bc?
    Frank

  • Combine 2 Queries (from SAME table) into a SINGLE query

    I have this two queries (from SAME table), and want to combine into one SINGLE query, how?
    How can we use CASE WHEN THEN for such situation? 
    Query1:
    SELECT t_inner.*,
    Floor(t_inner.ProductiveTime/ 3600) || 'hr:' || LPAD(Floor(Mod(t_inner.ProductiveTime,3600) / 60),2,0) || 'min:' AS Productive_Time,
    Floor(t_inner.OperatorDownTime/ 3600) || 'hr:' || LPAD(Floor(Mod(t_inner.OperatorDownTime,3600) / 60),2,0) || 'min:' AS OperatorDown_Time
    FROM
    (SELECT SYSTEMTYPE,
    sum(TIME_TEST + TIME_STEP) AS ProductiveTime,
    sum(TIME_IDLE) AS OperatorDownTime
    FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
    WHERE (SYSTEMTYPE = '0005-072')
    AND (TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
    AND TS_End <= to_date('17/01/2014', 'DD/MM/YYYY') + 1 + (1/1440) +(59/86400)
    AND MONO != '9999999999'
    GROUP BY SYSTEMTYPE ) t_inner
    Query 2:
    SELECT t_inner.*,
    Floor(t_inner.MachineDownTime/ 3600) || 'hr ' || LPAD(Floor(Mod(t_inner.MachineDownTime,3600) / 60),2,0) || 'min' AS MachineDown_Time
    FROM
    (SELECT SYSTEMTYPE,
    sum(TIME_IDLE) AS MachineDownTime
    FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
    WHERE (SYSTEMTYPE = '0005-072')
    AND (TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
    AND TS_End <= to_date('17/01/2014', 'DD/MM/YYYY') + 1 + (1/1440) +(59/86400)
    AND MONO = '9999999999'
    GROUP BY SYSTEMTYPE) t_inner
    see http://postimg.org/image/koq87iyyz/  and
    http://postimg.org/image/fv3zxa38n

    with the first query, 
    SELECT t_inner.*,
    Floor(t_inner.ProductiveTime/ 3600) || 'hr:' || LPAD(Floor(Mod(t_inner.ProductiveTime,3600) / 60),2,0) || 'min' AS Productive_Time
    FROM
    (SELECT SYSTEMTYPE,
    --sum(TIME_TEST) AS TIME_TEST,
    --sum(TIME_SYSTEM) AS TIME_SYSTEM,
    --sum(TIME_STEP) AS TIME_STEP,
    --sum(TIME_IDLE) AS TIME_IDLE,
    sum(TIME_TEST + TIME_STEP) AS ProductiveTime
    FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
    WHERE (SYSTEMTYPE = '0005-072')
    AND (TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
    AND TS_End <= to_date('17/01/2014', 'DD/MM/YYYY') + 1 + (1/1440) +(59/86400)
    AND MONO != '9999999999'
    GROUP BY SYSTEMTYPE) t_inner
    it gives output as from 
    http://postimg.org/image/koq87iyyz/
    with the second query,
    SELECT t_inner.*,
    Floor(t_inner.MachineDownTime/ 3600) || 'hr ' || LPAD(Floor(Mod(t_inner.MachineDownTime,3600) / 60),2,0) || 'min' AS MachineDown_Time
    FROM
    (SELECT SYSTEMTYPE,
    sum(TIME_IDLE) AS MachineDownTime
    FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
    WHERE (SYSTEMTYPE = '0005-072')
    AND (TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
    AND TS_End <= to_date('17/01/2014', 'DD/MM/YYYY') + 1 + (1/1440) +(59/86400)
    AND MONO = '9999999999'
    GROUP BY SYSTEMTYPE) t_inner
    it gives output as from 
    http://postimg.org/image/fv3zxa38n/
    I want to come those 2 queries into a single query, such that it gives both outputs as above. Let me know if you need any other information. thanks.

  • Getting column names for a particular Table from Connection object.

    Hi,
    Can any one suggests me a way to get column names from a particular table of a database from the java.sql.Connection object. ?
    Thanks in advance.

    Connection connection;
    DatabaseMetaData metadata = connection.getMetaData();
      String[] names = {"TABLE"};
      ResultSet tables = metadata.getTables(null,"%", "%", names);
      while (tables.next()) {
      String tableName = tables.getString("TABLE_NAME");
       ResultSet columns = metadata.getColumns(null, "%", tableName, "%");
    while (columns.next()) {
      String columnName = columns.getString("COLUMN_NAME");
        }

  • Pass an object from a static method

    Hi,
    I'm trying to pass a reference to an object from a static method, but I get an error when compiling.
    Say for example I have this:
    public class obj1 {
    public void myMethod (int i, Object ob, etc...) {
    ...and I want to call this method from a method that looks like this:
    public class obj2 {
    public static int anotherMethod(...) {
    obj1.myMethod(1,this,...);
    ...Can I pass a reference from obj2 to obj1 any other way?
    Thanks alot.

    how can I get a reference to obj2 then?Pay no attention to zdude's answer - it's nonsense.
    You're confused about basic Java concepts. obj2 is a class, not an object. References point to objects, not classes. There is no obj2 object in the code you show, so you cannot have a reference to an obj2 object.
    Maybe if you post some more code, we can get an idea of what you're trying to do. You might want to try the New to Java forum.

  • I purchased an album from itune, it's downloading the 5th of 7 songs and its stuck there for the last hour or so. how do i solve this. internet connection is good

    HELP. i just purchased a couple of albums from itunes. It's downloading but got stuck on the 5th song of album 1. internet connection's good. it says that the file being loaded is an MPEG-4 audiofile. what could be the problem? what can i do about it? can i skip this particular file to download the rest?

    If you're stuck on the part of the process where it says "Processing File" you're not alone.
    I downloaded an entire album, and two songs were stuck on "processing file".
    I'm pretty sure it's a problem on their end.
    What's worse is that I couldn't even restart my computer normally - I had to hold down the power button for 5 seconds and force shut down everything.

  • Trying to close Statement from its Connection object

    Hi, I am having difficulty finding information regarding how to find and kill a Statement for a given Connection. Unfortunately I do not have direct access to the Statement as the Connection object has been handed off and used externally.
    What I am doing is playing around with a connection pool and the effort to replace it with another at this point is not feasible, so basically what I am attempting to do is forcefully release a Connection after a specified timeout period but am finding that the Statement that it is running still persists. Waht I need to know is how I would be able to track down the Statement and .close() it as there does not seem to be any obvious way using the Connection object alone. Any ideas?
    Any help or suggestion about how to address this issue would be appreciated.

    Wrap the connection before handing it off to external code. Your wrapper will be responsible for tracking statement instances.

  • Connection Object from devices FM

    hi all,
    Is there any function Module that can be used to retrieve the connection object for a device.
    regds,
    stock

    Hi stock,
          Use ITOB_FUNCLOC_READ_SINGLE by inputing device in I_FUNC_LOCATION field. The resulting connection object will be in the export parameter E_OBJECT_REC. ie E_OBJECT_REC-TPLMA will be your connection object.
    Please reward points if useful.
    Regards,
    Harikrishna.

Maybe you are looking for

  • IPhone Earpiece not working

    My iPhone earpiece doesn't make any sounds. If I have the headphones in, I can hear a phone conversation, or if i have it on speaker, but when it's up to my ear I can't hear a thing. Is there a way to turn this feature on and off, that i accidentally

  • How can I read and write encrypted Mails with my iPhone?

    Thanks for any help.

  • R12 EFT for Germany/ Using Profile ICX:Numeric Characters

    Upgrading to Oracle R12.1.1 HP-UX 2000 Company based in US Hello - We are trying to setup AP EFT (e-Text) payments for Germany. The amount field is being selected from: DocumentPayable[1]/PaymentAmount/Value When we run the process, the EFT file is g

  • Help with the USB Recovery Flash Disk Creation Utility

    I've downloaded the utility (http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-77449-1&cc=uk&dlc=en&docnam... and encountered no problems. But when I try run it I only get as far the license agreement window. When I click next

  • Error message 1500, installation already in progress. Help!

    I'm having a problem. I was trying to download a program from Abbottdiabetescare.com so my husband can monitor his blood sugars. When it is almost finished loading, it comes up with an error message that says It says "Error 1500.  Another installatio