Determining the size of the resultset query

Oracle database version: 11.2.0.2.0

OS: OL 6.2

Requirement: When we run a query for example 'SELECT id, name FROM customers WHERE id < 1000000' I would like to know the size of the data that will be returned. Based on this information, I'll have to decide whether to send the output to the client requesting data or to generate the output file. For testing we can assume that if the size is more than 5 MB then a file must be generated otherwise output should be sent to the client directly.

To further clarify, this is a Web service that is consumed by many clients. We want to avoid too much traffic due to the huge amount of data requested by the consumers of the Web service. So what we think that if we know that the size is say 5 MB per request limit then send data or generate a file that can be placed somewhere on the Web server and the applicant will be provided a link to download.

To complicate matters further, please note that the solution is developed using .NET and queries arrive to the Oracle database server via SQL server using linked server. In Oracle, we use UTL_DBWS to the Web service.

Ideas, suggestions for help are highly appreciated.

It is not practical to send any more data to the client that the client can reasonable expect to scroll.

At best, which can be a few hundred lines.

You must provide a user two possibilities: 1) receives a game limited to rows nnn (where nnn may be different for different categories of users) of results or 2) to receive a file limited to lines of ppp (where ppp can be different for different classes of users).

For some users, it makes sense to allow them to create a gigantic million lines, whenever they feel like it.

You may NOT know the number of rows that will produce an arbitrary query. All you can do is provide a break when you reach a certain number of lines.

If you use a PIPELINED procedure it could limit the number of rows returned. It could also dynamically calculate a size of each line and limit the number of bytes. But the row limit is the thing to use.

Even this procedure don't know how many lines there will be in the end.

I'm more concerned that you have not really us said the WHOLE question.

Allowing even a line to be returned can be disastrous if it is the result of a Cartesian join and/or uses an order of. Who would use a huge amount of resources which would then just get put away after only one row is returned.

Are you sure that you don't need also to limit the resources that a user can require?

Safety management for users of database Oracle - 11g Release 2 (11.2)

On the limits of the user resources

You can set limits on the amount of various system resources available for each user in the field of the safety of this user. By doing so, you can prevent the uncontrolled consumption of valuable system resources such as time CPU. To set resource limits, you use the Resource Manager database, which is described in the Oracle database administrator's Guide.

Tags: Database

Similar Questions

  • How can I determine the size of the files and photo albums?

    How can I determine the size of the files and photo albums?

    It is not really in any way, nor is it necessary-what you trying to accomplish?

    LN

  • Soft pictures for Mac: how to determine the size of the image file

    Question: in the Photos for Mac, how can I determine the size of a photo or a video file

    Set-up the info panel does not include the size of the file.

    Furthermore, I don't see any place where I can do a "show in finder" to find the information in this way.

    Thank you!

    Can you not with the right button on the image file in the folder, the images are stored in, select "Get Info" and then find the size of the file in this way?

  • Questions about to determine the size of the array of data storage with flexibility

    I try to use the CVI function below to load data from .csv file to the table that I was intending to use later:

    filereturnvalue = FileSelectPopup ("c:\\Users\\Desktop\\FileDirectory", "*.csv", "", 'Select the data file', VAL_LOAD_BUTTON, 0, 0, 1, 0, LoadFilePath);

    FileToArray (DATAArray, VAL_CHAR, LoadFilePath, MaxDataSize, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_ASCII);

    For the data table "predetermined", it is quite straightforward, because the size of the table is already set.  However, I wonder if there is anyway I could use CVI directly import data and determine the size of the array on the fly?  Which means that the user need not know the length of the data, and it could be determined then to import the file.

    Hello

    for ASCII files, you can do so in any first read the file and counting the newline characters, something like:

    int file_handle;
    int index;
    int size = 0;
    char line_buffer [80];

    If (OpenFile (...) > 0)
    {
    While (ReadLine (...) > 0)
    {
    size ++;
    }
    }
    CloseFile(f) (file_handle);

    This way you can determine the number of rows you have, but you must have an idea of how long a line may be, one number per line or 32000 because you must specify the size of your line_buffer.

    In the next step you analyserions monotube for occurrence of your column separator (say a ;) to determine the number of columns (separators found + 1).

  • Determine the size of each Dimension of an array of 2D in TestStand

    How can I determine the size of each dimension of an array of 2D in TestStand?  myArray.GetNumElements () refers to the TOTAL number of elements in the table (2D) and does not help me.  I need to iterate on a single dimension.

    Thank you

    Andrew

    GetUpperBounds are but just not in this context. Try something like the following...

    Locals.MyDimensions = Locals.MyArray.Type.ArrayDimensions.GetUpperBounds)

    Where Locals.MyArray represents the 2D table you want dimensions of and Locals.MyDimensions is a 1 d array to store the dimensions. Something like...

    Locals.MyArray.Type.ArrayDimensions.GetUpperBounds () [0]

    ... might work as well, this example returns the number of elements in the first dimension of Locals.MyArray.

    Kind regards

    Steven Zittrower

    Technical sales engineer

    National Instruments

    http://www.NI.com/support

  • Determine the size of the container when using SizeUnit.PERCENT

    Hello

    How can I determine the width and height of a container, when I use the percentage of the size of the container?

    I have the following code, but this.width and this.height are both 0, causing the background sprite is not to demonstrate:

       public class HeaderContainer extends Container
        {
            private var _imgCategory:Image = new Image();
            private var _lblTitle:Label = new Label();
            private var _matrix:Matrix = new Matrix();
            private var _sprBackgroundColor:Sprite = new Sprite();
            private var _tfmtTitle:TextFormat = new TextFormat();
    
            public function HeaderContainer()
            {
                margins = Vector.([5,5,5,5]);
                debugColor = 0xCCCCCC; // grey
                flow = ContainerFlow.HORIZONTAL;
                align = ContainerAlign.NEAR;
                size = MyConstants.HEADER_SIZE;
                sizeUnit = SizeUnit.PERCENT;
                initializeUI();
            }
    
            public function initializeUI() : void
            {
                with (_sprBackgroundColor)
                {
                    x = y = 0;
                    graphics.beginFill(0x0000FF, 1);
                    graphics.drawRect(0, 0, this.width, this.height);
                    graphics.endFill();
                }
                ...
            }
    

    Have you tried to call the initializeUI method after the container has been added to the scene? You can easily register a handler to do this.

  • How to determine the size of the file and the pixel of an image?

    How to determine the size of the file and the pixel of an image?

    1 MB is 2 ^ 20 bytes. It is easy to represent long:

    final long MegaByte = 1048576L; //1048576 is 2^20 and L denotes that this is a long
    if(fileConn.fileSize() > MegaByte)
    {
    do something here
    }
    
  • How to determine the size of the screen

    Is there a way in OS Version 4.3.0 to determine when executing what the resolution of the screen of the device on which the application is running?

    Thanks for the help.

    Take a look at the net.rim.device.api.ui.Graphics class

    To determine the size of the screen use the static methods:

    Graphics.getScreenWidth ();

    Graphics.getScreenHeight ();

    To determine the resolution of the screen in pixels per meter (PPM), use the following static methods:

    Graphics.getScreenHorizontalResolution ();

    Graphics.getScreenVerticalResolution ();

  • Determine the size of the component during execution

    I am trying to build a component Paginagion of size fixed. The number of pages which means that the size of the paging is fixed, however depending on the content may vary. Most do not specify how much is displayed on a single page.

    The idea is to use the text as input and push as much as can be displayed on the page. Factors having an influence here is the fonts and formatting.

    To determine the page which you should see that I need to understand the amount of text that can be displayed. To do this, I need to know the size of the element that contains the text (think label). The size of the label is however only determined after that is layouted. So here's what I could do:

        @Override
        public void start(Stage primaryStage) {
            Label lbl = new Label("uitroweigudfgf jkfhgklfsjghslkghs kflgskjgh");
            System.out.println(lbl.getWidth()+","+lbl.getHeight());
            lbl.widthProperty().addListener(new ChangeListener<Number>(){
                @Override
                public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                    System.out.println(lbl.getWidth()+","+lbl.getHeight());
                }
            });
            lbl.heightProperty().addListener(new ChangeListener<Number>(){
                @Override
                public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                    System.out.println(lbl.getWidth()+","+lbl.getHeight());
                }
            });
            StackPane root = new StackPane();
            root.getChildren().add(lbl);
            
            Scene scene = new Scene(root, 300, 250);
            
            primaryStage.setTitle("Hello World!");
            primaryStage.setScene(scene);
            primaryStage.show();
       }
    

    After the third change, I have the dimensions of the label. With this method, I would have to push all of the text in labels to figure out what can be displayed.

    Is there a better way to do it?

    My basic problem was with the size of the labels. Try to find a solution I had a look at LabelSkinBase which uses the Utils class in the same package. This class provides methods (although private package) to calculate the size of the text that results from:

    static Text helper = new Text();
    
    static double computeTextWidth(Font font, String text, double wrappingWidth) {
      helper.setText(text);
      helper.setFont(font);
      // Note that the wrapping width needs to be set to zero before
     // getting the text's real preferred width.
      helper.setWrappingWidth(0);
      helper.setLineSpacing(0);
      double w = Math.min(helper.prefWidth(-1), wrappingWidth);
      helper.setWrappingWidth((int)Math.ceil(w));
      return Math.ceil(helper.getLayoutBounds().getWidth());
    }
    
    static double computeTextHeight(Font font, String text, double wrappingWidth) {
      return computeTextHeight(font, text, wrappingWidth, 0);
    }
    
    static double computeTextHeight(Font font, String text, double wrappingWidth, double lineSpacing) {
      helper.setText(text);
      helper.setFont(font);
      helper.setWrappingWidth((int)wrappingWidth);
      helper.setLineSpacing((int)lineSpacing);
      return helper.getLayoutBounds().getHeight();
    }
    
    static int computeTruncationIndex(Font font, String text, double width) {
      helper.setText(text);
      helper.setFont(font);
      helper.setWrappingWidth(0);
      helper.setLineSpacing(0);
      // The -2 is a fudge to make sure the result more often matches
      // what we get from using computeTextWidth instead. It's not yet
      // clear what causes the small discrepancies.
      Bounds bounds = helper.getLayoutBounds();
      Point2D endPoint = new Point2D(width - 2, bounds.getMinY() + bounds.getHeight() / 2);
      return helper.impl_hitTestChar(endPoint).getCharIndex();
    }
    

    With that, I am able to determine the amount of text can be put into the label, without the chain of ellipsis appears.

  • Determine the ratio of output size in BI Publisher

    Hello

    We need to send to printer large and smaller reports to be sent by e-mail. Does anyone know how to determine the result of running the report and change the method of delivery based on size?

    We are using 11.1.1.6.10 BEEP and using webservices to run the report. In runReport(), the report is sent as Base64Binary data and the deliveryMethod must be changed according to the size of report output. We use PDF, HTML, and CSV output formats, but do not know how to retrieve the size of the content of the report.

    Any help appreciated.

    Thank you

    We used 'sizeofReportDataChunk' tag in the runReport() XML request to determine the threshold of the size of the file output and inspiring as we do the logic for the features.

  • How determine the size of the flat.vmdk when all you have is a delta

    I need to find a way to determine the face of the virtual disk size parent but all that I've got a delta.vmdk

    the original descriptor of the delta.vmdk wiped white
    No logfiles, the vmsd vmsn files or similar there are other sources

    all I have is the *-delta.vmdk

    any ideas?

    Here is what I get when I add the delta file to a new virtual machine and the new vmdk. Size in the descriptor of the new vmdk and fixed delta.vmdk, the CID, VMX etc.

    Open "/ vmfs/volumes/8798ec34-05faf745/junk/ladybug1-000001.vmdk" (flags 0 x 8, type vmfsSparse).
    2011 04-05 T 22: 58:42.045Z | VMX | DISKLIB-VMFS: VmfsExtentCommonOpen: truncation realSize (?) as much as possible is 16777216, size in 40226760 descriptor.

    40226760 is correct. The 16777216 is the size of the new empty vmdk.

  • System tablespace allocation how oracle determines the size of the measure

    Hello

    It may be a silly question, but the I must request and obtain a few knowdge

    Assume that the allocation_type tablespace is system so how oracle determines the initial measurement and size max measure?

    Osama has provided useful links to the information you need. I'll just add with locally managed tablespace that the maximum number of spans is always unlimited even if you specify a value in the storage of declaration of establishment clause. Oracle does not take into account the value you provide and will with unlimited. I consider this unfortunate since in most cases, I know how large tables can reach and if the table extends beyond that point a developer made a mistake.

    HTH - Mark D Powell.

  • Determine the best image to overlay size to use

    Hi people

    So I'm working with Premiere Pro CS6 make a video montage of a Minister of my friends. Over pieces of the video, I was just overlap citations and whatnot. I would like to achieve consistency in always making sure that they are included on the same location on the screen. So I thought that a simple way to do it would be to determine the pixel size of the sequence. And the report of properties folder that my sequence is 1440 x 1080. I thought I could just create and manipulate images of this exact size and drop them to the exact location.

    The problem is that when I create an image of this size and drop it in PP, right monitor shows the image with areas of pillarboxed video on each side of it. The image certainly seems to be on-site with the altitude, but the width is off and I don't know why?

    So what is the explanation here? Certainly it seems that properties of the sequence are at odds with what this area right monitor in PP.

    PP.png

    Thank you... Rick

    You can specify the PAIR of titles that you create:

    .

    Basically, HD anamorphic uses rectangular pixels

    in order to crush the 16: 9 image in a setting of 4 x 3.

    First use-squishes' back pixels in 16 x 9.

    If your film the layer source is 1440 x 1080 (1.333).

    you are right in a sequence of 1440 x 1080 (1.333)...

    you just need to create the corresponding aspect / securities.

    If you use another application to create your .png images

    I'd be inclined to 1920 x 1080 (1.0).

    This will suit your anamorphic sequence regardless of the BY.

  • Determine the maximum length of a column and its use in the same query?

    I would like to determine the maximum length of a column and use it in the same query. Is this possible? IE:

    SELECT RPAD (last_name, SELECT MAX (LENGTH (last_name)) + 5 FROM user, '-')
    OF the user.

    Thank you

    Hello

    Welcome to the forum!

    jfraley wrote:
    I would like to determine the maximum length of a column and use it in the same query. Is this possible? IE:

    SELECT RPAD (last_name, SELECT MAX (LENGTH (last_name)) + 5 FROM user, '-')
    OF the user.

    Thank you

    Sure. You almost go in your message: a scalar subquery . Just put brackets around the subquery:

    SELECT      RPAD ( last_name
              , (
                 SELECT  MAX (LENGTH (last_name)) + 5
                 FROM    user_tbl          -- USER is not a good table name
                )
              , '-'
              )          AS padded_last_name
    FROM      user_tbl
    ;
    

    Scalar subqueries in SQL are like tape in your garage in canvas: they are used for thousands of different things and open, maybe 1% of them. Usually, there are better ways to achieve the same results, such as the analytical functions:

    SELECT      RPAD ( last_name
              , 5 + MAX (LENGTH (last_name)) OVER ()
              , '-'
              )          AS padded_last_name
    FROM      user_tbl
    ;
    

    Still another way is to make the subquery and then join his game as if it were a table of results:

    WITH     got_max_length     AS
    (
         SELECT     MAX (LENGTH (last_name))     AS max_length
         FROM     user_tbl
    )
    SELECT      RPAD ( u.last_name
              , m.max_length + 5
              , '-'
              )          AS padded_last_name
    FROM           user_tbl     u
    CROSS JOIN     got_max_length     m
    ;
    

    Published by: Frank Kulash, December 12, 2011 21:17
    Added cross join example

  • Formula to determine the size of the data store

    Is there a formula or a rule of thumb used to determine the size of a data store?

    For example, if I have 10 virtual computers that will need 20 GB of disk space, how big the data store be? I know that I have 200 GB of space for real virtual machines, but what other factors should be considered when sizing the data store?

    We usually leave 15 to 20% free space on all our datastoes.

    Here is a good article that can be useful to you as well

    http://SearchVMware.TechTarget.com/Tip/0, 289483, sid179_gci1350469_mem1, 00.html

Maybe you are looking for