Searching more partitions than necessary

I have a fact table that is partitioned by month:
PARTITION BY RANGE (request_timestamp)
( PARTITION requests_2004_01 VALUES LESS THAN (TO_DATE('2004-02', 'YYYY-MM'))
PARTITION requests_2004_02 VALUES LESS THAN (TO_DATE('2004-03', 'YYYY-MM'))
PARTITION requests_xxxx_xx VALUES LESS THAN (MAXVALUE) );
Now if I do
SELECT COUNT(*) FROM requests
WHERE
time >= TO_DATE('2005-02','YYYY-MM') AND
time < TO_DATE('2005-03','YYYY-MM');
the query executes fast, and the plan contains "PARTITION RANGE (SINGLE)", as expected.
But if I do
SELECT COUNT(*) FROM requests
WHERE
time >= TRUNC(ADD_MONTHS(CURRENT_DATE, -1), 'MONTH') AND
time < TRUNC(CURRENT_DATE, 'MONTH');
the query runs more than ten times slower, with "PARTITION RANGE (ITERATOR)".
Do I really have to hardcode the date literals, or is there a way to make the optimizer aware of the fact that it needs to look into one partition only (but without hardcoding the partition)?

actually your first query is according to optimizer range or in other words optimizer can understand it well and your second query using two function to get actual date so you should try here function based indexes on the column but for good performance you should use optimize queries like first one. avoide those queries which misdirect the optimizer

Similar Messages

  • Layout taking more space than necessary...

    Hi folks...my applet has two panels inside it arranged in a flowlayout. The first panel is a 5 row x 1 col gridlayout, and the second is working fine. The problem with the first one is that that it is taking more space than necessary and going out the bottom of the applet. Now if I do this in appletviewer, resizing the window by a few pixels will make it relayout the panel and everything looks fine, but of course you can't ask people to do that =) What's the problem here? I've tried validating both the applet and the problem panel, and tried invalidating it first. Any ideas? thanks!

    Here is the first half of it...it has all the relevant info. I took out the validate stuff 'cause it wasn't helping.
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Hashtable;
    public class Spit extends Applet implements KeyListener {
         Hashtable images = new Hashtable();
         CardPacket myPacket;
         PlayerCardPile[] myPiles;
         Hand myHand;
         CardPacket oppPacket;
         PlayerCardPile[] oppPiles;
         Hand oppHand;
         MainCardPile[] mainPiles;
         CardPile takenFrom;
         private final int WIDTH = 700;
         private final int HEIGHT= 800;
         Graphics offscreen;
         Image image;
         ChatPanel theChatPanel = new ChatPanel(this);
         public final int HAND = -1;
         public final int PACKET = -2;
         public final int LEFT_MAIN_PILE = 0;
         public final int RIGHT_MAIN_PILE = 1;
         boolean pendingMainPileMove = false;
         Panel gameSpace = new Panel();
         public void init() {
              loadImages();
              initPiles();
              placePiles();
              addKeyListener( this );
              myPacket.addKeyListener( this );
              mainPiles[0].addKeyListener( this );
              mainPiles[1].addKeyListener( this );
              for( int i = 0 ; i < 5 ; i++ )
                   myPiles.addKeyListener( this );
              image = createImage( WIDTH, HEIGHT );
              offscreen = image.getGraphics();
              myPacket.requestFocus();
         public void loadImages() {
              MediaTracker t = new MediaTracker(this);
              for( int i = Card.CLUB; i <= Card.SPADE ; i++ )
                   for( int j = Card.ACE; j <= Card.KING; j++ )
                        images.put( Card.toString(i,j),
                             getImage(getCodeBase(),"images/"+Card.toString(i,j)+".gif") );
              images.put( "back", getImage(getCodeBase(),"images/back.gif") );
              // wait for all images to finish loading
              try {
                   t.waitForAll();
              }catch (InterruptedException e) {}
              // check for errors //
              if (t.isErrorAny()) {
                   showStatus("Error Loading Images!");
              else if (t.checkAll()) {
                   showStatus("Images successfully loaded");
         public void dealNewGame() {
              emptyPiles();
              Deck theDeck = new Deck( images );
              for( int i = 0 ; i < 26 ; i++ )
                   oppPacket.add( theDeck.getCard(i) );
              for( int i = 26 ; i < 52 ; i++ )
                   myPacket.add( theDeck.getCard(i) );
              theChatPanel.sendCardPackets( oppPacket.toString() , myPacket.toString() );
              dealMyPacket();
              dealOppPacket();
              repaint();
         public void dealMyPacket() {
              for( int i = 0 ; i < 5 && myPacket.numCards() > 0 ; i++ ) {
                   for( int j = i ; j < 5 && myPacket.numCards() > 0 ; j++ ) {
                        Card temp = myPacket.remove();
                        if( j == i )
                             temp.flip();
                        myPiles[j].deal( temp );
                   myPiles[i].repaint();
         public void dealOppPacket() {
              for( int i = 0 ; i < 5 && oppPacket.numCards() > 0 ; i++ ) {
                   for( int j = i ; j < 5 && oppPacket.numCards() > 0 ; j++ ) {
                        Card temp = oppPacket.remove();
                        if( j == i )
                             temp.flip();
                        oppPiles[j].deal( temp );
                   oppPiles[i].repaint();
         public void setPackets( String strMyPack , String strOppPack ) {
              emptyPiles();
              myPacket.replaceWith( CardPacket.parseString( strMyPack , images ) );
              oppPacket.replaceWith( CardPacket.parseString( strOppPack , images ) );
              dealMyPacket();
              dealOppPacket();
         public void setOppPacket( String strOppPack ) {
              String strMyPack = myPacket.toString();
              emptyPiles();
              myPacket.replaceWith( CardPacket.parseString( strMyPack , images ) );
              oppPacket.replaceWith( CardPacket.parseString( strOppPack , images ) );
              dealMyPacket();
              dealOppPacket();
         public void emptyPiles() {
              myPacket.makeEmpty();
              oppPacket.makeEmpty();
              myHand.makeEmpty();
              oppHand.makeEmpty();
              for( int i = 0 ; i < 5 ; i++ ) {
                   myPiles[i].makeEmpty();
                   oppPiles[i].makeEmpty();
              mainPiles[0].makeEmpty();
              mainPiles[1].makeEmpty();
         public void initPiles() {
              myPacket = new CardPacket();
              myPiles = new PlayerCardPile[5];
              myHand = new Hand();
              oppPacket = new CardPacket();
              oppPiles = new PlayerCardPile[5];
              oppHand = new Hand();
              mainPiles = new MainCardPile[2];
              for( int i = 0 ; i < 5 ; i++ ) {
                   oppPiles[i] = new PlayerCardPile();
                   myPiles[i] = new PlayerCardPile();
              mainPiles[0] = new MainCardPile();
              mainPiles[1] = new MainCardPile();
         public void placePiles() {
              Panel row1 = new Panel();
              row1.add( (Component)oppHand );
              row1.add( (Component)oppPacket );
              Panel row2 = new Panel();
              for( int i = 4 ; i >= 0 ; i-- )
                   row2.add((Component)oppPiles[i]);
              Panel row3 = new Panel();
              row3.add( mainPiles[0] = new MainCardPile() );
              row3.add( mainPiles[1] = new MainCardPile() );
              Panel row4 = new Panel();
              for( int i = 0 ; i < 5 ; i++ )
                   row4.add((Component)myPiles[i]);
              Panel row5 = new Panel();
              row5.add((Component)myPacket);
              row5.add((Component)myHand);
              gameSpace.setLayout( new GridLayout(5,1) );
              gameSpace.add(row1);
              gameSpace.add(row2);
              gameSpace.add(row3);
              gameSpace.add(row4);
              gameSpace.add(row5);
              this.add( gameSpace );
              this.add( theChatPanel );
              this.setBackground( Color.white );
              gameSpace.setBackground( Color.white );
              theChatPanel.setBackground( Color.white );
    public void paint( Graphics g ) {
              super.paint( offscreen );
              offscreen.setColor(Color.white);
              offscreen.fillRect(0,0,WIDTH,HEIGHT);
              g.drawImage(image,0,0,this);

  • Time machine need more space than necessary.

    Hi.
    Can anyone help. I have a two 1TB external hard drives one backs the other up. Until now it has been fine but suddenly time machine has decided theres not enough room even though there the same size drives. Ive deleted the backup drive and the time machine preferences but it still wont work. I have one drive with 930GB on and time machine says it needs 1.1TB of space. Why dose it need an extra 170GB. Help?
    Thanks

    Since Time Machine keeps copies of previous versions of things you've changed or deleted, it needs much more space than the data it's backing-up.
    The extra 170 GB is for "padding" -- workspace on the backup volume, and in case the original estimate isn't accurate, or more files are changed or added while the backup is running.
    #1 in the link Carolyn supplied explains this a bit more, and recomends that your backup drive be 2-3 times the size of the data it's backing-up.

  • What did you buy that was more powerful than necessary... but totally worth it?

    Hey folks, hope you guys will tune into this week'sOn the Air (10am CT on 7/15)where we are talking about "The MostPowerful Workstations in the Universe!"We're going to talk with HPand Spicehead Travis0729about why and when you need to go above and beyond regular consumer-grade laptops and desktops and what's available if you do.Of course, in these cases, usually the added power is warranted and makes sense. Today I'm more interested in when it's completely UNNECESSARY, but totally worth it.For me, it would definitely have to be my Vitamix blender. Not sure if any of you have one but this blender is so powerful it can actually heat up soup through the friction of the blades alone. You can even argue it's still easier to blend the soup and then heat it up separately, but no, it's not nearly as cool.
    So let me know if there's anything...

    STS has partnered with Neverware to bring you new and exciting software!This software replaces Windows or Mac OSX with a customized version of Chromium OS, effectively and efficiently transforming your computer into a fast, reliable, and easy-to-manage Google Apps experience.Withour program, you can choose the best solution for you:Convert your existing computers in-houseSend us your computers for converting and/or refurbishingTrade your computers for our Chrome converted PC’sBuy or lease our Chrome converted PC’sSo, what is the best solution for you? Complete afree quote formand a representative will contact you with pricing andqualified devices!

  • Time Machine requiring more space than necessary?

    Hi all,
    Since I only have a 60gb external drive (whereas my laptop has 250gb) I burned some files to DVDs and then excluded them from the Time Machine backup so the backup would fit in 60gb (~56gb, really).
    Anyways, when I managed to reduce the size of my backup to around 51gb, I got a message saying that the backup would require 64.7gb. I thought it was okay, maybe TM needs a bit more space for whatever reason. But even after shrinking by backup to only 41gb, it still says 64.7gb are needed!
    I'm desperate because I haven't been able to find a solution and thus I've been unable to backup my files.
    Thanks in advance

    Thanks for your replies, but I am perfectly aware of how TM works and that I need a bigger hard disk to back up.
    A friend also has a computer with a 250 HDD and he backs up perfectly around 50gb of files in a 60gb hard disk.
    I've formatted my disk and I'm doing this as my first backup, so I know there are no 'extra files' to be backed up besides those I've chosen not to exclude.
    But my question is why does TM require exactly the same disk space (64.6GB) with different backup sizes (from 35GB to 53GB), it's ALWAYS the same space!
    I really appreciate your replies, though. =)

  • Time machine deleting many more backups than necessary - how to stop it?

    I did something that I expected to cause a full backup and might require TM to do some cleanup. Time machine has started eating my old backups and has quite a healthy appetite. I'm quite afraid it's going to wipe out my entire backlog of backups.
    So here's what I did:
    - turned off TM
    - defragmented my boot disk* by using SuperDuper to create a clone of my boot disk, reformat my boot disk, clone back to my boot disk
    - Selected "Choose Disk" in TM
    - Selected "Backup Now"
    (I expected TM to do a full backup do to changed i-nodes on the file or whatnot)
    TM thinned out the backups as expected by removing weekly backups for the prior month. It then proceeded to start deleting old backups.
    At last count, my TM Disk had 452.87GB of 999.86GB. My boot disk is using 142.49GB free of 319.73GB. So, there would be room for a full backup even if my boot disk was completely full but it's not.
    What can I do to get TM back on track without losing all my old backups?
    Thanks,
    Dean
    * Yes, I know I don't NEED to defrag, but even Apple recognizes that if you do a lot of video work, it's possible you might actually benefit from a defrag.

    Dean Thompson wrote:
    I did something that I expected to cause a full backup and might require TM to do some cleanup. Time machine has started eating my old backups and has quite a healthy appetite. I'm quite afraid it's going to wipe out my entire backlog of backups.
    So here's what I did:
    - turned off TM
    - defragmented my boot disk* by using SuperDuper to create a clone of my boot disk, reformat my boot disk, clone back to my boot disk
    Any time you replace everything on a disk (or the disk itself), it's considered changed and will be backed-up in it's entirety. This even happens if you do a full system restore from TM backups: http://support.apple.com/kb/TS1338
    The new backup will require as much space as the data on your internal HD, plus 20% for workspace.
    At last count, my TM Disk had 452.87GB of 999.86GB. My boot disk is using 142.49GB free of 319.73GB. So, there would be room for a full backup even if my boot disk was completely full but it's not.
    So the backup should require about 170 GB of free space.
    To confirm what's going on, Click here to download the +Time Machine Buddy+ widget. It shows the messages from your logs for one TM backup run at a time, in a small window. Navigate to the backup in question, then copy and post the messages (but only to the first deletion) for that run here.

  • Search more than one location at a time?

    Hello,
    I spend a lot of my time searching for files in our studio (I maintain the archives, backups, file systems, etc.) and I have to search across a number of locations (a number of local drives, specific locations/folders on various servers, etc.). Right now all our machines in the studio are on Tiger and I'm considering upgrading to 10.5, but the one major roadblock I've come across thus far is the ability to search various locations in 10.5. In 10.4 I was able to select multiple locations (local machine, specific folders on file and archive servers, etc.) all at once to find what I need. In 10.5 I've been unable to find a way to search more than one location at a time. Am I missing something, or has Apple removed the ability to search like this? This would be a serious roadblock for me as it would mean each search I do would have to be done 2-5 times, depending on what I'm looking for and where it could be found. I've even tried created a "search" folder which contains alias folders to all the places I'd normally search, but this didn't work.
    If anyone has any advice on how I could possible do this, it would be greatly appreciated!
    Regards,
    Kristin.

    Yea, I understand how to search in 10.5 (either using the magnify glass in top right, or command-F) but what I'm trying to figure out is how to search "This Mac" AND a folder on a server at the same time. In 10.4 you could just click on the places you wanted to search, but in 10.5 this option is gone. When you search "This Mac" (no matter how you customize your search), it only searches the Mac your on and mounted drives via USB and FireWire. It doesn't search other networked computers and servers and you have no option to search a specific folder on a networked computer or server unless you actually navigate to that folder and run the search (at which point you're only searching that folder and no longer also searching the "This Mac").
    You can customize a lot of things, but what feature that's lacking in the 10.5 searching is the ability to search specific/various locations across a network.
    In the studio it would be specific the computer I'm working on (a Mac Pro [not Macbook Pro]) and it's connected to 20 other Macs (G5 towers, Intel iMacs and Mac Pros) and two servers (Xserves). I only need to search specific locations on these systems, which you can't seem to do in 10.5. In fact, I haven't even found a way to search all the computers on the network, let alone specific locations on these computers on the network, all at once.
    I've been trying to figure this out all weekend (at home) via the following setup:
    - Intel iMac
    - External FireWire drive mounted on Intel iMac
    - G4 Server "connected" via Intel iMac
    In each of these locations I've placed the following folders:
    #1 - FIND THIS FILE - IMAC DESKTOP (on iMac desktop)
    #2 - FIND THIS FILE - FW HD (on external FW drive mounted to iMac)
    #3 - FIND THIS FILE - G4 DESKTOP (on G4 Server desktop connected to iMac)
    When I run the search, if I select "This Mac" it finds both folders #1 & #2, but NOT #3.
    The only way I can get the search to find #3 is to navigate via Finder to the G4 and run a search. But, now it's only searching the G4 Server and thus only find #3 and NOT #1 or #2.
    I can either search "This Mac" (and mounted drives) OR the G4 Server, but not both.
    At this point I have tried everything I can to get this to work, but nothing. I believe there is NO WAY to search various locations (especially various specific locations) across the network and that Apple has removed this ability in 10.5. I would LOVE if someone could prove me wrong!?
    Regards,
    Kristin.

  • 'Find an Item' search on list with more items than view limit

    Hello all
    The 'Find and Item' search on a list with more items than the view limit appears to filter results according to where you are in that list.  So if I search on the allitems page displaying items 1-100 I get hits from the entire list.  But if I arrow
    through to view items 201-300 and repeat the same search only items from 201 to the end of the list are returned
    I'm assuming this is not how it should work i.e. it should always return results from the whole list.  Is there a way to make that so (other than increasing the view limit to something huge so that all items are always displayed)
    Many Thanks
    Dan

    Hi,
    According to your post, my understanding is that Find an item Search box in List didn't returned any results.
    The problem is due to a difference between the Content Source defined for the crawl and the default zone defined in the Alternate Access mapping.
    You need to change the Alternate Access Mapping configuration.
    For more information, you can refer to:
    http://blog.jonathanroussel.com/2009/01/sharepoint-search-using-this-site-or.html
    http://blog.dafran.ca/post/2011/07/02/SharePoint-does-not-return-any-search-results.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • The original 5 meters distance router in WiFi signal is full, but the beginning of the past few days more than 3 meters on the search to the WiFi signal, my own iPhone 5, iPhone 4S received signal is full, only iPad2 searching for less than the signal.

    The original 5 meters distance router in WiFi signal is full, but the beginning of the past few days more than 3 meters on the search to the WiFi signal, my own iPhone 5, iPhone 4S received signal is full, only iPad2 searching for less than the signal.

    The original 5 meters distance router in WiFi signal is full, but the beginning of the past few days more than 3 meters on the search to the WiFi signal, my own iPhone 5, iPhone 4S received signal is full, only iPad2 searching for less than the signal.

  • CollectionEvent UPDATE event dispatched more than necessary

    Hello,
    I am using Flex 4.  The objects that populate my data grid have these two fields:  tag and transcribedText.  Both of these fields are editable.
    When I make a change/changes to the same record, the COLLECTIONEVENT UPDATE event is dispatched more than necessary, creating redundant PropertyChangeEvent objects.
    Please refer to the following example.  I have screenshots to give more details but am unable to copy/paste or attach them.
    1. I first changed the transcribedText from “add services” to “add services TODAY”.
    2. I then changed the tag from “OrderGeneral” to “OrderInternet”.
    3. I finally clicked outside of the affected line.
    The COLLECTIONEVENT UPDATE event is dispatched THREE times.
    1. In the first dispatch, there are two PropertyChangeEvent objects, and the second one is a repeat of the first one (transcribedText change) but with oldValue and newValue both set to null.
    2. In the second dispatch, there is only one PropertyChangeEvent object, and it correctly captures the tag change.
    3. In the third dispatch, there is only one PropertyChangeEvent object, and it is a repeat of the previous tag change but with oldValue and newValue both set to null.
    Why is this happening?
    Thanks for your help!
    Bonnie

    COLLECTION_CHANGE events are tied to the data provider itself, not to the data grid though.
    One interesting observation is that the REMOVE event is dispatched only one time.
    When I was using the itemEditEnd event tied to the data grid, I also witnessed that this event was dispatched two times when only one change was made.
    Any other thoughts?
    Bonnie

  • Query in timesten taking more time than query in oracle database

    Hi,
    Can anyone please explain me why query in timesten taking more time
    than query in oracle database.
    I am mentioning in detail what are my settings and what have I done
    step by step.........
    1.This is the table I created in Oracle datababase
    (Oracle Database 10g Enterprise Edition Release 10.2.0.1.0)...
    CREATE TABLE student (
    id NUMBER(9) primary keY ,
    first_name VARCHAR2(10),
    last_name VARCHAR2(10)
    2.THIS IS THE ANONYMOUS BLOCK I USE TO
    POPULATE THE STUDENT TABLE(TOTAL 2599999 ROWS)...
    declare
    firstname varchar2(12);
    lastname varchar2(12);
    catt number(9);
    begin
    for cntr in 1..2599999 loop
    firstname:=(cntr+8)||'f';
    lastname:=(cntr+2)||'l';
    if cntr like '%9999' then
    dbms_output.put_line(cntr);
    end if;
    insert into student values(cntr,firstname, lastname);
    end loop;
    end;
    3. MY DSN IS SET THE FOLLWING WAY..
    DATA STORE PATH- G:\dipesh3repo\db
    LOG DIRECTORY- G:\dipesh3repo\log
    PERM DATA SIZE-1000
    TEMP DATA SIZE-1000
    MY TIMESTEN VERSION-
    C:\Documents and Settings\dipesh>ttversion
    TimesTen Release 7.0.3.0.0 (32 bit NT) (tt70_32:17000) 2007-09-19T16:04:16Z
    Instance admin: dipesh
    Instance home directory: G:\TimestTen\TT70_32
    Daemon home directory: G:\TimestTen\TT70_32\srv\info
    THEN I CONNECT TO THE TIMESTEN DATABASE
    C:\Documents and Settings\dipesh> ttisql
    command>connect "dsn=dipesh3;oraclepwd=tiger";
    4. THEN I START THE AGENT
    call ttCacheUidPwdSet('SCOTT','TIGER');
    Command> CALL ttCacheStart();
    5.THEN I CREATE THE READ ONLY CACHE GROUP AND LOAD IT
    create readonly cache group rc_student autorefresh
    interval 5 seconds from student
    (id int not null primary key, first_name varchar2(10), last_name varchar2(10));
    load cache group rc_student commit every 100 rows;
    6.NOW I CAN ACCESS THE TABLES FROM TIMESTEN AND PERFORM THE QUERY
    I SET THE TIMING..
    command>TIMING 1;
    consider this query now..
    Command> select * from student where first_name='2155666f';
    < 2155658, 2155666f, 2155660l >
    1 row found.
    Execution time (SQLExecute + Fetch Loop) = 0.668822 seconds.
    another query-
    Command> SELECT * FROM STUDENTS WHERE FIRST_NAME='2340009f';
    2206: Table SCOTT.STUDENTS not found
    Execution time (SQLPrepare) = 0.074964 seconds.
    The command failed.
    Command> SELECT * FROM STUDENT where first_name='2093434f';
    < 2093426, 2093434f, 2093428l >
    1 row found.
    Execution time (SQLExecute + Fetch Loop) = 0.585897 seconds.
    Command>
    7.NOW I PERFORM THE SIMILAR QUERIES FROM SQLPLUS...
    SQL> SELECT * FROM STUDENT WHERE FIRST_NAME='1498671f';
    ID FIRST_NAME LAST_NAME
    1498663 1498671f 1498665l
    Elapsed: 00:00:00.15
    Can anyone please explain me why query in timesten taking more time
    that query in oracle database.
    Message was edited by: Dipesh Majumdar
    user542575
    Message was edited by:
    user542575

    TimesTen
    Hardware: Windows Server 2003 R2 Enterprise x64; 8 x Dual-core AMD 8216 2.41GHz processors; 32 GB RAM
    Version: 7.0.4.0.0 64 bit
    Schema:
    create usermanaged cache group factCache from
    MV_US_DATAMART
    ORDER_DATE               DATE,
    IF_SYSTEM               VARCHAR2(32) NOT NULL,
    GROUPING_ID                TT_BIGINT,
    TIME_DIM_ID               TT_INTEGER NOT NULL,
    BUSINESS_DIM_ID          TT_INTEGER NOT NULL,
    ACCOUNT_DIM_ID               TT_INTEGER NOT NULL,
    ORDERTYPE_DIM_ID          TT_INTEGER NOT NULL,
    INSTR_DIM_ID               TT_INTEGER NOT NULL,
    EXECUTION_DIM_ID          TT_INTEGER NOT NULL,
    EXEC_EXCHANGE_DIM_ID TT_INTEGER NOT NULL,
    NO_ORDERS               TT_BIGINT,
    FILLED_QUANTITY          TT_BIGINT,
    CNT_FILLED_QUANTITY          TT_BIGINT,
    QUANTITY               TT_BIGINT,
    CNT_QUANTITY               TT_BIGINT,
    COMMISSION               BINARY_FLOAT,
    CNT_COMMISSION               TT_BIGINT,
    FILLS_NUMBER               TT_BIGINT,
    CNT_FILLS_NUMBER          TT_BIGINT,
    AGGRESSIVE_FILLS          TT_BIGINT,
    CNT_AGGRESSIVE_FILLS          TT_BIGINT,
    NOTIONAL               BINARY_FLOAT,
    CNT_NOTIONAL               TT_BIGINT,
    TOTAL_PRICE               BINARY_FLOAT,
    CNT_TOTAL_PRICE          TT_BIGINT,
    CANCELLED_ORDERS_COUNT          TT_BIGINT,
    CNT_CANCELLED_ORDERS_COUNT     TT_BIGINT,
    ROUTED_ORDERS_NO          TT_BIGINT,
    CNT_ROUTED_ORDERS_NO          TT_BIGINT,
    ROUTED_LIQUIDITY_QTY          TT_BIGINT,
    CNT_ROUTED_LIQUIDITY_QTY     TT_BIGINT,
    REMOVED_LIQUIDITY_QTY          TT_BIGINT,
    CNT_REMOVED_LIQUIDITY_QTY     TT_BIGINT,
    ADDED_LIQUIDITY_QTY          TT_BIGINT,
    CNT_ADDED_LIQUIDITY_QTY     TT_BIGINT,
    AGENT_CHARGES               BINARY_FLOAT,
    CNT_AGENT_CHARGES          TT_BIGINT,
    CLEARING_CHARGES          BINARY_FLOAT,
    CNT_CLEARING_CHARGES          TT_BIGINT,
    EXECUTION_CHARGES          BINARY_FLOAT,
    CNT_EXECUTION_CHARGES          TT_BIGINT,
    TRANSACTION_CHARGES          BINARY_FLOAT,
    CNT_TRANSACTION_CHARGES     TT_BIGINT,
    ORDER_MANAGEMENT          BINARY_FLOAT,
    CNT_ORDER_MANAGEMENT          TT_BIGINT,
    SETTLEMENT_CHARGES          BINARY_FLOAT,
    CNT_SETTLEMENT_CHARGES          TT_BIGINT,
    RECOVERED_AGENT          BINARY_FLOAT,
    CNT_RECOVERED_AGENT          TT_BIGINT,
    RECOVERED_CLEARING          BINARY_FLOAT,
    CNT_RECOVERED_CLEARING          TT_BIGINT,
    RECOVERED_EXECUTION          BINARY_FLOAT,
    CNT_RECOVERED_EXECUTION     TT_BIGINT,
    RECOVERED_TRANSACTION          BINARY_FLOAT,
    CNT_RECOVERED_TRANSACTION     TT_BIGINT,
    RECOVERED_ORD_MGT          BINARY_FLOAT,
    CNT_RECOVERED_ORD_MGT          TT_BIGINT,
    RECOVERED_SETTLEMENT          BINARY_FLOAT,
    CNT_RECOVERED_SETTLEMENT     TT_BIGINT,
    CLIENT_AGENT               BINARY_FLOAT,
    CNT_CLIENT_AGENT          TT_BIGINT,
    CLIENT_ORDER_MGT          BINARY_FLOAT,
    CNT_CLIENT_ORDER_MGT          TT_BIGINT,
    CLIENT_EXEC               BINARY_FLOAT,
    CNT_CLIENT_EXEC          TT_BIGINT,
    CLIENT_TRANS               BINARY_FLOAT,
    CNT_CLIENT_TRANS          TT_BIGINT,
    CLIENT_CLEARING          BINARY_FLOAT,
    CNT_CLIENT_CLEARING          TT_BIGINT,
    CLIENT_SETTLE               BINARY_FLOAT,
    CNT_CLIENT_SETTLE          TT_BIGINT,
    CHARGEABLE_TAXES          BINARY_FLOAT,
    CNT_CHARGEABLE_TAXES          TT_BIGINT,
    VENDOR_CHARGE               BINARY_FLOAT,
    CNT_VENDOR_CHARGE          TT_BIGINT,
    ROUTING_CHARGES          BINARY_FLOAT,
    CNT_ROUTING_CHARGES          TT_BIGINT,
    RECOVERED_ROUTING          BINARY_FLOAT,
    CNT_RECOVERED_ROUTING          TT_BIGINT,
    CLIENT_ROUTING               BINARY_FLOAT,
    CNT_CLIENT_ROUTING          TT_BIGINT,
    TICKET_CHARGES               BINARY_FLOAT,
    CNT_TICKET_CHARGES          TT_BIGINT,
    RECOVERED_TICKET_CHARGES     BINARY_FLOAT,
    CNT_RECOVERED_TICKET_CHARGES     TT_BIGINT,
    PRIMARY KEY(ORDER_DATE, TIME_DIM_ID, BUSINESS_DIM_ID, ACCOUNT_DIM_ID, ORDERTYPE_DIM_ID, INSTR_DIM_ID, EXECUTION_DIM_ID,EXEC_EXCHANGE_DIM_ID),
    READONLY);
    No of rows: 2228558
    Config:
    < CkptFrequency, 600 >
    < CkptLogVolume, 0 >
    < CkptRate, 0 >
    < ConnectionCharacterSet, US7ASCII >
    < ConnectionName, tt_us_dma >
    < Connections, 64 >
    < DataBaseCharacterSet, AL32UTF8 >
    < DataStore, e:\andrew\datacache\usDMA >
    < DurableCommits, 0 >
    < GroupRestrict, <NULL> >
    < LockLevel, 0 >
    < LockWait, 10 >
    < LogBuffSize, 65536 >
    < LogDir, e:\andrew\datacache\ >
    < LogFileSize, 64 >
    < LogFlushMethod, 1 >
    < LogPurge, 0 >
    < Logging, 1 >
    < MemoryLock, 0 >
    < NLS_LENGTH_SEMANTICS, BYTE >
    < NLS_NCHAR_CONV_EXCP, 0 >
    < NLS_SORT, BINARY >
    < OracleID, NYCATP1 >
    < PassThrough, 0 >
    < PermSize, 4000 >
    < PermWarnThreshold, 90 >
    < PrivateCommands, 0 >
    < Preallocate, 0 >
    < QueryThreshold, 0 >
    < RACCallback, 0 >
    < SQLQueryTimeout, 0 >
    < TempSize, 514 >
    < TempWarnThreshold, 90 >
    < Temporary, 1 >
    < TransparentLoad, 0 >
    < TypeMode, 0 >
    < UID, OS_OWNER >
    ORACLE:
    Hardware: Sunos 5.10; 24x1.8Ghz (unsure of type); 82 GB RAM
    Version 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    Schema:
    CREATE MATERIALIZED VIEW OS_OWNER.MV_US_DATAMART
    TABLESPACE TS_OS
    PARTITION BY RANGE (ORDER_DATE)
    PARTITION MV_US_DATAMART_MINVAL VALUES LESS THAN (TO_DATE(' 2007-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_NOV_D1 VALUES LESS THAN (TO_DATE(' 2007-11-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_NOV_D2 VALUES LESS THAN (TO_DATE(' 2007-11-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_NOV_D3 VALUES LESS THAN (TO_DATE(' 2007-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_DEC_D1 VALUES LESS THAN (TO_DATE(' 2007-12-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_DEC_D2 VALUES LESS THAN (TO_DATE(' 2007-12-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_DEC_D3 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_08_JAN_D1 VALUES LESS THAN (TO_DATE(' 2008-01-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_08_JAN_D2 VALUES LESS THAN (TO_DATE(' 2008-01-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_08_JAN_D3 VALUES LESS THAN (TO_DATE(' 2008-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_MAXVAL VALUES LESS THAN (MAXVALUE)
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS
    NOCACHE
    NOCOMPRESS
    NOPARALLEL
    BUILD DEFERRED
    USING INDEX
    TABLESPACE TS_OS_INDEX
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    ENABLE QUERY REWRITE
    AS
    SELECT order_date, if_system,
    GROUPING_ID (order_date,
    if_system,
    business_dim_id,
    time_dim_id,
    account_dim_id,
    ordertype_dim_id,
    instr_dim_id,
    execution_dim_id,
    exec_exchange_dim_id
    ) GROUPING_ID,
    /* ============ DIMENSIONS ============ */
    time_dim_id, business_dim_id, account_dim_id, ordertype_dim_id,
    instr_dim_id, execution_dim_id, exec_exchange_dim_id,
    /* ============ MEASURES ============ */
    -- o.FX_RATE /* FX_RATE */,
    COUNT (*) no_orders,
    -- SUM(NO_ORDERS) NO_ORDERS,
    -- COUNT(NO_ORDERS) CNT_NO_ORDERS,
    SUM (filled_quantity) filled_quantity,
    COUNT (filled_quantity) cnt_filled_quantity, SUM (quantity) quantity,
    COUNT (quantity) cnt_quantity, SUM (commission) commission,
    COUNT (commission) cnt_commission, SUM (fills_number) fills_number,
    COUNT (fills_number) cnt_fills_number,
    SUM (aggressive_fills) aggressive_fills,
    COUNT (aggressive_fills) cnt_aggressive_fills,
    SUM (fx_rate * filled_quantity * average_price) notional,
    COUNT (fx_rate * filled_quantity * average_price) cnt_notional,
    SUM (fx_rate * fills_number * average_price) total_price,
    COUNT (fx_rate * fills_number * average_price) cnt_total_price,
    SUM (CASE
    WHEN order_status = 'C'
    THEN 1
    ELSE 0
    END) cancelled_orders_count,
    COUNT (CASE
    WHEN order_status = 'C'
    THEN 1
    ELSE 0
    END
    ) cnt_cancelled_orders_count,
    -- SUM(t.FX_RATE*t.NO_FILLS*t.AVG_PRICE) AVERAGE_PRICE,
    -- SUM(FILLS_NUMBER*AVERAGE_PRICE) STAGING_AVERAGE_PRICE,
    -- COUNT(FILLS_NUMBER*AVERAGE_PRICE) CNT_STAGING_AVERAGE_PRICE,
    SUM (routed_orders_no) routed_orders_no,
    COUNT (routed_orders_no) cnt_routed_orders_no,
    SUM (routed_liquidity_qty) routed_liquidity_qty,
    COUNT (routed_liquidity_qty) cnt_routed_liquidity_qty,
    SUM (removed_liquidity_qty) removed_liquidity_qty,
    COUNT (removed_liquidity_qty) cnt_removed_liquidity_qty,
    SUM (added_liquidity_qty) added_liquidity_qty,
    COUNT (added_liquidity_qty) cnt_added_liquidity_qty,
    SUM (agent_charges) agent_charges,
    COUNT (agent_charges) cnt_agent_charges,
    SUM (clearing_charges) clearing_charges,
    COUNT (clearing_charges) cnt_clearing_charges,
    SUM (execution_charges) execution_charges,
    COUNT (execution_charges) cnt_execution_charges,
    SUM (transaction_charges) transaction_charges,
    COUNT (transaction_charges) cnt_transaction_charges,
    SUM (order_management) order_management,
    COUNT (order_management) cnt_order_management,
    SUM (settlement_charges) settlement_charges,
    COUNT (settlement_charges) cnt_settlement_charges,
    SUM (recovered_agent) recovered_agent,
    COUNT (recovered_agent) cnt_recovered_agent,
    SUM (recovered_clearing) recovered_clearing,
    COUNT (recovered_clearing) cnt_recovered_clearing,
    SUM (recovered_execution) recovered_execution,
    COUNT (recovered_execution) cnt_recovered_execution,
    SUM (recovered_transaction) recovered_transaction,
    COUNT (recovered_transaction) cnt_recovered_transaction,
    SUM (recovered_ord_mgt) recovered_ord_mgt,
    COUNT (recovered_ord_mgt) cnt_recovered_ord_mgt,
    SUM (recovered_settlement) recovered_settlement,
    COUNT (recovered_settlement) cnt_recovered_settlement,
    SUM (client_agent) client_agent,
    COUNT (client_agent) cnt_client_agent,
    SUM (client_order_mgt) client_order_mgt,
    COUNT (client_order_mgt) cnt_client_order_mgt,
    SUM (client_exec) client_exec, COUNT (client_exec) cnt_client_exec,
    SUM (client_trans) client_trans,
    COUNT (client_trans) cnt_client_trans,
    SUM (client_clearing) client_clearing,
    COUNT (client_clearing) cnt_client_clearing,
    SUM (client_settle) client_settle,
    COUNT (client_settle) cnt_client_settle,
    SUM (chargeable_taxes) chargeable_taxes,
    COUNT (chargeable_taxes) cnt_chargeable_taxes,
    SUM (vendor_charge) vendor_charge,
    COUNT (vendor_charge) cnt_vendor_charge,
    SUM (routing_charges) routing_charges,
    COUNT (routing_charges) cnt_routing_charges,
    SUM (recovered_routing) recovered_routing,
    COUNT (recovered_routing) cnt_recovered_routing,
    SUM (client_routing) client_routing,
    COUNT (client_routing) cnt_client_routing,
    SUM (ticket_charges) ticket_charges,
    COUNT (ticket_charges) cnt_ticket_charges,
    SUM (recovered_ticket_charges) recovered_ticket_charges,
    COUNT (recovered_ticket_charges) cnt_recovered_ticket_charges
    FROM us_datamart_raw
    GROUP BY order_date,
    if_system,
    business_dim_id,
    time_dim_id,
    account_dim_id,
    ordertype_dim_id,
    instr_dim_id,
    execution_dim_id,
    exec_exchange_dim_id;
    -- Note: Index I_SNAP$_MV_US_DATAMART will be created automatically
    -- by Oracle with the associated materialized view.
    CREATE UNIQUE INDEX OS_OWNER.MV_US_DATAMART_UDX ON OS_OWNER.MV_US_DATAMART
    (ORDER_DATE, TIME_DIM_ID, BUSINESS_DIM_ID, ACCOUNT_DIM_ID, ORDERTYPE_DIM_ID,
    INSTR_DIM_ID, EXECUTION_DIM_ID, EXEC_EXCHANGE_DIM_ID)
    NOLOGGING
    NOPARALLEL
    COMPRESS 7;
    No of rows: 2228558
    The query (taken Mondrian) I run against each of them is:
    select sum("MV_US_DATAMART"."NOTIONAL") as "m0"
    --, sum("MV_US_DATAMART"."FILLED_QUANTITY") as "m1"
    --, sum("MV_US_DATAMART"."AGENT_CHARGES") as "m2"
    --, sum("MV_US_DATAMART"."CLEARING_CHARGES") as "m3"
    --, sum("MV_US_DATAMART"."EXECUTION_CHARGES") as "m4"
    --, sum("MV_US_DATAMART"."TRANSACTION_CHARGES") as "m5"
    --, sum("MV_US_DATAMART"."ROUTING_CHARGES") as "m6"
    --, sum("MV_US_DATAMART"."ORDER_MANAGEMENT") as "m7"
    --, sum("MV_US_DATAMART"."SETTLEMENT_CHARGES") as "m8"
    --, sum("MV_US_DATAMART"."COMMISSION") as "m9"
    --, sum("MV_US_DATAMART"."RECOVERED_AGENT") as "m10"
    --, sum("MV_US_DATAMART"."RECOVERED_CLEARING") as "m11"
    --,sum("MV_US_DATAMART"."RECOVERED_EXECUTION") as "m12"
    --,sum("MV_US_DATAMART"."RECOVERED_TRANSACTION") as "m13"
    --, sum("MV_US_DATAMART"."RECOVERED_ROUTING") as "m14"
    --, sum("MV_US_DATAMART"."RECOVERED_ORD_MGT") as "m15"
    --, sum("MV_US_DATAMART"."RECOVERED_SETTLEMENT") as "m16"
    --, sum("MV_US_DATAMART"."RECOVERED_TICKET_CHARGES") as "m17"
    --,sum("MV_US_DATAMART"."TICKET_CHARGES") as "m18"
    --, sum("MV_US_DATAMART"."VENDOR_CHARGE") as "m19"
              from "OS_OWNER"."MV_US_DATAMART" "MV_US_DATAMART"
    where I uncomment a column at a time and rerun. I improved the TimesTen results since my first post, by retyping the NUMBER columns to BINARY_FLOAT. The results I got were:
    No Columns     ORACLE     TimesTen     
    1     1.05     0.94     
    2     1.07     1.47     
    3     2.04     1.8     
    4     2.06     2.08     
    5     2.09     2.4     
    6     3.01     2.67     
    7     4.02     3.06     
    8     4.03     3.37     
    9     4.04     3.62     
    10     4.06     4.02     
    11     4.08     4.31     
    12     4.09     4.61     
    13     5.01     4.76     
    14     5.02     5.06     
    15     5.04     5.25     
    16     5.05     5.48     
    17     5.08     5.84     
    18     6     6.21     
    19     6.02     6.34     
    20     6.04     6.75

  • ColdFusion 11: custom serialisers. More questions than answers

    G'day:
    I am reposting this from my blog ("ColdFusion 11: custom serialisers. More questions than answers") at the suggestion of Adobe support:
    @dacCfml @ColdFusion Can you post your queries at http://t.co/8UF4uCajTC for all cfclient and mobile queries.— Anit Kumar Panda (@anitkumar85) April 29, 2014
    This particular question is not regarding <cfclient>, hence posting it on the regular forum, not on the mobile-specific one as Anit suggested. I have edited this in places to remove language that will be deemed inappropriate by the censors here. Changes I have made are in [square brackets]. The forums software here has broken some of the styling, but so be it.
    G'day:
    I've been wanting to write an article about the new custom serialiser one can have in ColdFusion 11, but having looked at it I have more questions than I have answers, so I have put it off. But, equally, I have no place to ask the questions, so I'm stymied. So I figured I'd write an article covering my initial questions. Maybe someone can answer then.
    ColdFusion 11 has added the notion of a custom serialiser a website can have (docs: "Support for pluggable serializer and deserializer"). The idea is that whilst Adobe can dictate the serialisation rules for its own data types, it cannot sensibly infer how a CFC instance might get serialised: as each CFC represents a different data "schema", there is no "one size fits all" approach to handling it. So this is where the custom serialiser comes in. Kind of. If it wasn't a bit rubbish. Here's my exploration thusfar.
    One can specify a custom serialiser by adding a setting to Application.cfc:
    component {     this.name = "serialiser01";     this.customSerializer="Serialiser"; }
    In this case the value - Serialiser - is the name of a CFC, eg:
    // Serialiser.cfccomponent {     public function canSerialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return true;     }     public function canDeserialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return true;     }     public function serialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return "SERIALISED";     }     public function deserialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return "DESERIALISED";     }     private function logArgs(required struct args, required string from){         var dumpFile = getDirectoryFromPath(getCurrentTemplatePath()) & "dump_#from#.html";         if (fileExists(dumpFile)){             fileDelete(dumpFile);         }         writeDump(var=args, label=from, output=dumpFile, format="html");     } }
    This CFC needs to implement four methods:
    canSerialize() - indicates whether something can be serialised by the serialiser;
    canDeserialize() - indicates whether something can be deserialised by the serialiser;
    serialize() - the function used to serialise something
    deserialize() - the function used to deserialise something
    I'm being purposely vague on those functions for a reason. I'll get to that.
    The first [issue] in the implementation here is that for the custom serialisation to work, all four of those methods must be implemented in the serisalisation CFC. So common sense would dictate that a way to enforce that would be to require the CFC to implement an interface. That's what interfaces are for. Now I know people will argue the merit of having interfaces in CFML, but I don't really give a [monkey's] about that: CFML has interfaces, and this is what they're for. So when one specifies the serialiser in Application.cfc and it doesn't fulfil the interface requirement, it should error. Right then. When one specifies the inappropriate tool for the job. What instead happens is if the functions are omitted, one will get erratic behaviour in the application, through to outright errors when ColdFusion goes to call the functions and cannot find it. EG: if I have canSerialize() but no serialize() method, CF will error when it comes to serialise something:
    JSON serialization failure: Unable to serialize to JSON.
    Reason : The method serialize was not found in component C:/wwwroot/scribble/shared/git/blogExamples/coldfusion/CF11/customerserialiser/Serialiser .cfc.
    The error occurred inC:/wwwroot/scribble/shared/git/blogExamples/coldfusion/CF11/customerserialiser/testBasic.c fm: line 4
    2 : o = new Basic();
    3 :
    4 : serialised = serializeJson(o);5 : writeDump([serialised]);
    6 :
    Note that the error comes when I go to serialise something, not when ColdFusion is told about the serialiser in the first place. This is just lazy/thoughtless implementation on the part of Adobe. It invites bugs, and is just sloppy.
    The second [issue] follows immediately on from this.
    Given my sample serialiser above, I then run this test code to examine some stuff:
    o = new Basic(); serialised = serializeJson(o); writeDump([serialised]); deserialised = deserializeJson(serialised); writeDump([deserialised]);
    So all I'm doing is using (de)serializeJson() as a baseline to see how the functions work. here's Basic.cfc, btw:
    component { }
    And the test output:
    array
    1
    SERIALISED
    array
    1
    DESERIALISED
    This is as one would expect. OK, so that "works". But now... you'll've noted I am logging the arguments each of the serialisation methods receives, as I got.
    Here's the arguments passed to canSerialize():
    canSerialize - struct
    1
    XML
    My reaction to that is: "[WTH]?" Why is canSerialize() being passed the string "XML" when I'm trying to serialise an object of type Basic.cfc?
    Here's the docs for canSerialize() (from the page I linked to earlier):
    CanSerialize - Returns a boolean value and takes the "Accept Type" of the request as the argument. You can return true if you want the customserialzer to serialize the data to the passed argument type.
    Again, back to "[WTH]?" What's the "Accept type" of the request? And what the hell has the request got to do with a call to serializeJson()? You might think that "Accept type" references some HTTP header or something, but there is no "Accept type" header in the HTTP spec (that I can find: "Hypertext Transfer Protocol -- HTTP/1.1: 14 Header Field Definitions"). There's an "Accept" header (in this case: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"), and other ones like "Accept-Encoding", "Accept-Language"... but none of which contain a value of "XML". Even if there was... how would it be relevant to the question as to whether a Basic.cfc instance can be serialised? Raised as bug: 3750730.
    serialize() gets more sensible arguments:
    serialize - struct
    1
    https://www.blogger.com/nullserialize - component scribble.shared.git.blogExamples.coldfusion.CF11.customerserialiser.Basic
    2
    JSON
    So the first is the object to serialise (which surely should be part of the question canSerialize() is supposed to ask, and the format to serialise to. Cool.
    canDeserialize() is passed this:
    canDeserialize - struct
    1
    JSON
    I guess it's because it's being called from deserializeJson(), so it's legit to expect the input value is indeed JSON. Fair enough. (Note: I'm not actually passing it JSON, but that's beside the point here).
    And deserialize() is passed this:
    deserialize - struct
    1
    SERIALISED
    2
    JSON
    3
    [empty string]
    The first argument is the value to work on, and the second is the type of deserialisation to do. I have no idea what the third argument is for, and it's not mentioned directly or indirectly on that docs page. So dunno what the story is there.
    The next issue isn't a code-oriented one, but an implementation one: how the hell are we expected to work with this?
    The only way to work here is for each function to have a long array of IF/ELSEIF statements which somehow identify each object type that is serialisable, and then return true from canSerialise(), or in the case of serialize(), go ahead and do the serialisation. So this means this one CFC needs to know about everything which can be serialised in the entire application. Talk about a failure in "separation of concerns".
    You know the best way of determining if an object can be seriaslised? Ask it! Don't rely on something else needing to know. This can be achieved very easily in one of two ways:
    Check to see if the object implements a "Serializable" interface, which requires a serialize() method to exist.
    Or simply take the duck-typing approach: if a CFC implements a serialize() method: it can be serialised. By calling that method. Job done.
    Either approach would work fine, keeps things nicely encapsulated, and I see merits in both. And either make far more sense than Adobe's approach. Which is like something from the "OO Failures Special Needs" class.
    Deserialisation is trickier. Because it relies on somehow working out how to deserialise() an object. I'm not sure of the best approach here, but - again - how to deserialise something should be as close to the thing needing deserialisation as possible. IE: something in the serialised data itself which can be used to bootstrap the process.
    This could simply be a matter of specifying a CFC type at a known place in the serialised data. EG: Adobe stipulates that if the serialised data is JSON, and at the top level of the JSON is a key eg: type, and the value is an extant CFC... use that CFC's deserialize() method. Or it could look for an object which contains a type and a method, or whatever. But Adobe can specify a contract there.
    The only place I see a centralised CFC being relevant here is for a mechanism for handling serialised data that is neither a ColdFusion internal type, nor identifiable as above. In this case, perhaps they could provide a mechanism for a serialisation router, which basically has a bunch of routes (if/elseifs if need be) which contains logic as to how to work out how to deserialise the data. But it should not be the actual deserialiser, it should simply have the mechanism to find out how to do it. This is actually pretty much the same in operation as the deserialize() approach in the current implementation, but it doesn't need the canDeserialize() method (it can return false at the end of the routing), and it doesn't need to know about serialising. And also it's not the main mechanism to do the deserialisation, it's just the fall back if the prescribed approach hasn't been used.
    TBH, this still sounds a bit jerry-built, and I'm open for better suggestions. This is probably a well-trod subject in other languages, so it might be worth looking at how the likes of Groovy, Ruby or even PHP (eek!) achieve this.
    There's still another issue with the current approach. And this demonstrates that the Adobe guys don't actually work with either CFML applications or even modern websites. This approach only works for a single, stand-alone website (like how we might have done in 2001). What if I'm not in the business of building websites, but I build applications such as FW/1 or ColdBox or the like? Or any sort of "helper" application. They cannot use the current Adobe implementation of the customserializer. Why? Because the serialisation code needs to be in a website-specific CFC. There's no way for Luis to implement a custom serialiser in ColdBox (for example), and then have it work for someone using ColdBox. Because it relies on either editing Application.cfc to specify a different CFC, or editing the existing customSerializer CFC. Neither of which are very good solutions. This should have been immediately apparent to the Adobe engineer(s) implementing this stuff had they actually had any experience with modern web applications (which generally aren't just a single monolithic site, but an aggregation of various other sub applications). Equally, I know it's not a case of having thought about this and [I'm just missing something], because when I asked them the other day, at first they didn't even get what I was asking, but when I clarified were just like "oh yeah... um... err... yeah, you can't do that. We'll... have to... ah yeah". This has been raised as bug 3750731.
    So I declare the intent here valid, but the implementation to be more alpha- / pre-release- quality, not release-ready.
    Still: it could be easily deprecated and rework fairly easily. I've raised this as bug 3750732.
    Or am I missing something?
    Adam

    Yes, you can easily add additional questions to the Lookup.WebClient.Questions Lookup to allow some additional choices. We have added quite a few additional choices, we have noticed that removing them once people have selected them causes some errors.
    You can also customize the required number of questions to select when each user sets them up as well as the number required to be correct to reset the password, these options are in the System Configuration settings.
    If you need multi-language versions of the questions, you will also need to modify the appropriate language resource file in the xlWebApp.war file to provide the necessary translations for the values entered into the Lookup.

  • I have a Canon MX882 and more often than note get an error message saying the printer is not connected. I check the printer and the get the message that the access point is accessed. I have reloaded the software and it worked for awhile. Any ideas?

    I have a Canon MX882 printer and more often than note get an error message that says "Printer not Connected." When I check the printer itself, I get confirmation that the access point is connected. I tried reloading the software and that seemed to have solved the problem for awhile but I'm experiencing the same problem. Any ideas what is causing this?

    Did you delete all receipts with iDVD in the file name  with either a .PKG or .BOM extension that reside in the HD/Library/Receipts folder and from the /var/db/receipts/  folder before installing the new copy?  If not then do so and delete the new application also.
    Click to view full size
    Then install iPhoto from the disk it came on originally and apply all necessary updaters: Apple - Support - Downloads
    OT

  • More ram than specs call for

    Specs for my emac specify support for 1GB of ram. In searching for additional ram (I presently have 512MB) I have found some suppliers that claim you can install 2GB (1GB in each of the two slots). I called and they said they have tested this and it works fine. I consider the company I called to be reputable. Has anyone heard of this? What would be the downside of trying it out - other than the extra cost? Is there some kind of power limitations or something that might harm my computer?
    Thanks for any insight,
    Doug

    Ya if you do a search of this group, you will find this has come up a LOT of times and yes your Mac can use more RAM than 1GB if you want.
    JIMacG5 I think is being a bit paranoid since, A) your eMac is probably long out of warranty anyway and B) Apple only tests up to whatever RAM was available at the time the model was in production. They do not test RAM for old models so many old models have outdates RAM specs and can use a lot more than they "officially" state they do.
    Patrick

  • Photo Creations in PSE9 at another partition than C:

    Hi,
    The internal HDD in my pc with Windows XP has more than one partition.
    My C: partition has a restricted space, so from th DVD I have installed Adobe Photoshop Elements 9 (PSE9) on the D: partition which has much more space than on C:
    But after having installed PSE9 on D: I found on C: a subdirectory called
    "/Documents and Settings/All Users/Application Data/Adobe/Photoshop Elements/9.0/Photo Creations"
    which uses nearly 1,5 Gb of space!
    Is it possible to let install that on the D: partition as well?
    Thank you in advance...

    Dear Gerry,
    This is a clear and helpull answer to me. So, I have to sort out to
    other (big) files/maps on C: to move or to increase the partition.
    Thank you for your reaction.
    Op 25-4-2012 14:02, ukgaurav schreef:
    >
          Re: Photo Creations in PSE9 at another partition than C:
    created by ukgaurav <http://forums.adobe.com/people/ukgaurav> in
    /Photoshop Elements/ - View the full discussion
    <http://forums.adobe.com/message/4359597#4359597

Maybe you are looking for

  • Does a new contract mean you should get new phone? NEW MEANS NEW,RIGHT?

    I signed a 2 year contract and got what I was told was a brand new Blackberry Tour. Problem is when I sent in the rebate, they said the rebate was already given for that particular device. Long story short, the phone had so many problems it was not u

  • Encoding on mail. Pls help

    Hi, I am getting problem while sending some character thru javax.mail API. I want to send message like �esky ������. When i set this message to MimeMessage it works fine. But in mail, it looks like }}} etcetc junk character. Can anyone tell me on thi

  • Display flashes / blinks

    Ever since I received my mac book pro a few weeks ago the screen will periodically flash off and back on / black out for a fraction of a second. What should I do about this send my lap top back?

  • Lists not viewing properly in Netscape and Mozilla

    I am in the process of designing a website which has left and right column lists (with different styles/formatting). It views OK in Internet Explorer but does not view properly in Netscape or Mozilla. Below are some links to see the problem: www.ambi

  • Scale in price

    hi all, i have this req, the price in sales order is determined based on quantity that has already good issued. i keep good issue quantity in info structure. ex: we have deliver/good issue 1000 PCS by last month. in the beginning of this month, i cre