Spatial Query, Use Multiple Cores

Basic question, is SQL 2012 running on Windows 2008 R2 64 bit expected to use multiple cores to execute it's tasks?
I have a table of points, 480, that has 3 empty columns that are being updated from 3 separate tables of polygons via a spatial join based on an intersection (STIntersects) of the point and polygons. All of the data is in 4326 and all tables have spatial
indexes.
The server running this query has 32 logical cores, but only 1 core is used and it is maxed out. It takes 53 seconds to complete the update. I have over a million points that need this done. I want to assume that if SQL can access more cores it will complete
faster.
I've looked at the actual execution plan and there is a 99% cost on the spatial query.
update A
set CONGRESS_DISTRICT = B.DISTRICT, HOUSE_DISTRICT = C.DISTRICT, SENATE_DISTRICT = D.DISTRICT
from [LegislativeMapData2014].[dbo].[CNRM_INFORCE_EXTRACT093014_COMBINED_GEOCODED] A
inner join [LegislativeMapData2014].[dbo].[CONGRESS_2014] B
on A.FEATURE_SHAPE.STIntersects(B.FEATURE_SHAPE) = 1
inner join [LegislativeMapData2014].[dbo].[HOUSE_2014] C
on A.FEATURE_SHAPE.STIntersects(C.FEATURE_SHAPE) = 1
inner join [LegislativeMapData2014].[dbo].[SENATE_2014] D
on A.FEATURE_SHAPE.STIntersects(D.FEATURE_SHAPE) = 1
Is there anything I can do to improve the performance of the query? Do I need to hint the indexes? Or something else?
Thanks

Hi,
updating millions of records could lock your resource and other users may have trouble connecting or reading data.
In some cases, variable table is your friend, insert the data you needed to a variable table before issuing the update.
with that, you may need to have (nolock) on each table. eg. 
[LegislativeMapData2014].[dbo].[CONGRESS_2014] (nolock)
Regards,
gioVhan
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Similar Messages

  • Does iMovie09 use multiple cores??

    Does iMovies 09 take advantage of multiples cores such as the core i5 or the core i7? this is really the deal breaker for me in buying the new 27 inch iMac.

    Not as far as I know.
    One thing to realize is that it is very complicated for an application programmer to write code that takes advantage of multiple cores. Apple has addressed this in Snow Leopard by providing a system framework called Grand Central Dispatch that makes it simpler for application developers to use multiple cores. It still will take one or more development cycles before developers really start taking advantage of this.

  • Spatial Query with multiple geometries from 2 tables

    Hi,
    I'm using Oracle 8.1.7. I am trying to do a spatial query on two tables with multiple geometries. There are two spatial tables. One made up of points and one made up of polygons. There are 829551 rows in the table of points and 1817795 rows in the table with polygons...
    I want to find all polygons where one of this points is within it...
    This query is pretty intensive querying two large spatial tables against each other and so I need to find the most efficient way of running this query. I've been running variations of my query for the last two week and every time it's bombed out with various errors after 12-24 hrs processing like out of memory, out of tablespace, out of processing, invalid index etc etc etc. I need to get this query run asap... Any tips would be gratefully appreciated..
    For the session running the query I've allocated 16M sort area with
    ALTER SESSION SET SORT_AREA_SIZE=16777216;
    Below is the query I'm running... How can I improve this please? BTW PARCEL_OVERLAPS contains the points and TP$_PARCEL_AREAS the polygons.
    SELECT lu.LNU_PARCEL_ID
         FROM
              seventy.PARCEL_OVERLAPS po,
              imap_topol.TP$_PARCEL_AREAS pa,
              TP$_PARCEL_CENTROID_AREA pca,
              TDCR_LAND_UNIT lu
         WHERE
              SDO_FILTER(po.geometry, pa.area,
              'querytype=WINDOW') = ’TRUE’ and
              sdo_within_distance(po.geometry,pa.area,'distance=0')='TRUE' and
              pa.delete_date is null and
              Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
              pa.AREA_ID = pca.AREA_ID and
              pca.DELETE_DATE IS NULL and
              pa.DELETE_DATE IS NULL;

    Albert,
    Thanks for your reply and the tips you've given. The tp$_parcel_areas table will always be bigger so I've changed the order to sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE'. The requested counts for those queries are
    12:26:29 [email protected]:SQL> select count(*)
    13:46:22 2 from seventy.PARCEL_OVERLAPS;
    COUNT(*)
    612
    13:48:12 [email protected]:SQL> select count(*)
    13:48:17 2 from imap_topol.TP$_PARCEL_AREAS pa,
    13:48:21 3 TP$_PARCEL_CENTROID_AREA pca
    13:48:21 4 where pca.DELETE_DATE IS NULL
    13:48:21 5 and pa.DELETE_DATE IS NULL
    13:48:21 6 and pa.AREA_ID = pca.AREA_ID;
    COUNT(*)
    1310665
    There was no reason for both filter and within_distance. I did try use the anyinteract but for some reason that does not return the desired results(I've added one id row as a test to make sure it returns desired results). Plus Oracle have recomended using the within distance for better performance..
    so the explan plan for
    14:38:37 [email protected]:SQL> EXPLAIN PLAN FOR
    14:38:50 2 SELECT lu.LNU_PARCEL_ID
    14:38:50 3 FROM
    14:38:50 4 seventy.PARCEL_OVERLAPS po,
    14:38:50 5 imap_topol.TP$_PARCEL_AREAS pa,
    14:38:50 6 TP$_PARCEL_CENTROID_AREA pca,
    14:38:50 7 TDCR_LAND_UNIT lu
    14:38:50 8 WHERE
    14:38:50 9 sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE' and
    14:38:50 10 pa.delete_date is null and
    14:38:50 11 Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
    14:38:50 12 pa.AREA_ID = pca.AREA_ID and
    14:38:50 13 pca.DELETE_DATE IS NULL and
    14:38:50 14 pa.DELETE_DATE IS NULL;
    is
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 4G|32920G| 547M| | |
    | NESTED LOOPS | | 4G|32920G| 547M| | |
    | MERGE JOIN | | 547M| 2029G| 230124 | | |
    | SORT JOIN | | 1M| 36M| 85014 | | |
    | MERGE JOIN | | 1M| 36M| 50019 | | |
    | SORT JOIN | | 1M| 17M| 21650 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 1M| 17M| 485 | | |
    | SORT JOIN | | 1M| 22M| 28369 | | |
    | TABLE ACCESS FULL |TDCR_LAND | 1M| 22M| 2127 | | |
    | SORT JOIN | | 42K| 160M| 145111 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 42K| 160M| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    14:43:14 [email protected]:SQL> explain plan for
    14:43:23 2 SELECT pa.AREA_ID
    14:43:23 3 FROM seventy.PARCEL_OVERLAPS po,
    14:43:23 4 imap_topol.TP$_PARCEL_AREAS pa
    14:43:23 5 WHERE SDO_RELATE(po.geometry, pa.area,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:43:23 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 10M| | |
    | NESTED LOOPS | | 6M| 50G| 10M| | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    14:45:03 [email protected]:SQL> explain plan for
    14:45:04 2 SELECT pa.AREA_ID
    14:45:05 3 FROM seventy.PARCEL_OVERLAPS po,
    14:45:05 4 imap_topol.TP$_PARCEL_AREAS pa
    14:45:05 5 WHERE SDO_RELATE(pa.area, po.geometry,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:45:05 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 863554 | | |
    | NESTED LOOPS | | 6M| 50G| 863554 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    --------------------------------------------------------------------------------

  • AE CS5 is not using Multiple Cores

    I have a six core Intel I7 980X machine which i've got running at over 4GHz, yet AE is completely not making use of this speed.
    I've turned on "Render Multiple Frames Simultaneously", and set it to use all cores (it detects 12 because of hyper threading on the I7 CPU's) and this does nothing for both the Preview window/working area or when actually rendering a video in the Render Queue. It uses about 9% at most of my CPU, that's not even 2 full cores.
    I also have two SSD drives in RAID 0, they're Crucial C300 SSD's, pretty much the fastest you can get, infinitely faster than any Hard Drive, yet again... not making use of these it seems. I also have 12GB DDR3 running at 2GHz, i've set AE to use 9GB of it, as much as it will allow.... yet i cant even work with HD 1080p material and get near to smooth performance or even play it smoothly with or without effects applied, atleast with the video/viewer window near to 1080p size. Really pathetic. Premiere Pro on the other hard does a much better job but still dont fully make use of the speed and cores available. Adobe Media Encoder also does not use all cores.
    Other software and even games make way better use of these cores than Adobe software seems to.
    I've got two ATI 5870 graphics cards in Crossfire mode, they have the latest drivers. Performance is like this on any driver version though, but as far as i know none of this software makes use of the GPU's like it does with certain CUDA based Nvidia cards. I'd still like it to actually make use of my other hardware though.
    I'm most bothered about AE, so any ideas why AE CS5 is [edited] so badly?
    This is on Win7 x64.
    Thanks for your help!

    I've atleast made the renderer work a little faster by ticking "Enable OpenGL" in the Render Settings, and increasing the amount of used graphics card RAM to 800MB.
    I also tried doing what those Blog posts said in the FAQ links - It has not helped much, if at all. So i tried a few different other RAM settings too, which didn't really help.
    Then i put the video files on my SSD drives, and that helped a little. But not much difference still overall, very unimpressed with AE CS5 performance. It's took me hours to put together a 1min 30secs video that has 6 video files in total with some lens blur and colour grading effects applied, that's just silly, even for often slow Adobe software.
    Cant see this happening but i'd like it if Adobe almost completely focus on performance for CS6 and hardly add any new features. While also making use of the speed of Solid State Drives and having GPU's also made use of more. I mean my SSD's are capable of reading around 600MB/sec and doing 40,000 I/O's per second but none of this is being made use of.

  • Using Multiple Cores

    Hi,
    I'm new to Qmaster, and I'm trying to use it to utilize multiple cores when exporting video from Compressor. I following instructions to get the option of a cluster other than "This Computer" in Compressor:
    First, go to System Preferences.
    Choose Apple Qmaster
    Stop Sharing if it's on.
    Set to Quick Cluster with Services
    Select "Distributed processing for Compressor"
    Click on Options for Selected Service. You can choose from 1 to 8 instances, depending on the number of cores you have.
    Give your Quick Cluster a name like "op's Local Cluster."
    Once you have the options set, click Start Sharing, and close the prefere
    I did all this, and it didn't work. Then I found someone telling me to deselect "Managed" and select "Shared" in services, and my new cluster finally showed up in Compressor. However, when I submit batches to that cluster, nothing happens. Time elapses, but to the best of my knowledge, no video is being produced. Am I doing something wrong, or just reading what's going on incorrectly?

    Bryan G. wrote:
    Jon Chappell, why are you saying that Qmaster has to launch multiple instances of whatever app is doing the compressing? If you have multiple Macs networked together, you don't even need to have FCPro installed to use Qmaster services.
    http://manuals.info.apple.com/en/Qmaster3Compressor_3_Distributed_ProcessingSetup.pdf
    See p.77.
    To export a Final Cut Pro sequence directly to Compressor for distributed processing:
    1 *Make sure Final Cut Pro is installed on each computer in the cluster that you intend to use for distributed processing.*
    Each installation of Final Cut Pro requires a product serial number. For information about volume licenses, go to http://www.apple.com/finalcutstudio.
    But as I said, that's only if you export directly from FCP. If you export to a QuickTime movie first and then import that to Compressor, that will work fine without FCP being installed. You will, of course, need the necessary codecs installed on the cluster machines though.

  • Logic not using multiple cores?

    I have a project that seems to be burning out my CPU. The music starts distorting and crackling, and I've noticed that the little CPU indicator is hitting the top of the chart. But, I also have the iStat monitor installed, and the CPU never reads as going above 50%.
    I have a dual core intel, is it possible that Logic is using only one core?

    I have the same problem.
    On a i7 iMac with 16 gigs of ram. Logic is only using one core no matter what settings I use (auto, 8 or 4), and even using the bus rerouting trick the plugins still run on the same core. That core create glitch when it reaches 100%, but really only 25% of my iMac is used.
    Way to get us spending money, pay 3000$ for a computer that is 4 times faster than the previous one, but then your limited to 25% of what you paid for.

  • Spatial query results in core dump

    Following query leads to a core dump error. I only can get the first 45 rows.
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [_kokekd2m+43] [PC:0x13A71A3] [ADDR:0x65CECD14] [UNABLE_TO_READ] []
    SELECT geom.link_id, geom.link
    FROM state
    JOIN link ON state.state_id=link.state_id
    JOIN geom ON link.link_id=geom.link_id
    WHERE MDSYS.SDO_FILTER(link, MDSYS.SDO_GEOMETRY(2003, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(-118, 36, -114, 40)), 'querytype=WINDOW') = 'TRUE'
    AND state.class=1
    If i change the select clause to:
    SELECT count(geom.link_id) ...
    it works fine.
    Does anyone has similar experience?

    Hi,
    I'm not sure this is exactly relevant but there used to be a bug (certainly in 9i) wherby if you had a SDO_GEOMETRY column in a result set (or subquery) that was being subjected to a sort operation and there were more than a certain figure (32K rings a bell although I could be wrong on that) of rows then it would die. The sort wasn't necessarily a "user" sort - it could be being performed by the database to speed up a join or group by.
    Which version of the DB are you using?
    If you just try this :
    SELECT geom.link_id
    FROM state
    JOIN link ON state.state_id=link.state_id
    JOIN geom ON link.link_id=geom.link_id
    WHERE MDSYS.SDO_FILTER(link, MDSYS.SDO_GEOMETRY(2003, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(-118, 36, -114, 40)), 'querytype=WINDOW') = 'TRUE'
    AND state.class=1
    i.e just remove the geometry column from the results set, does this work?
    If it does than you may need to wrap this (working) query up as a subselect and join back to your original table to get the geometry "back" if you need it.....
    Steve

  • Spatial query using C#

    hi,
    we're getting some odd behaviour using the Oracle Data Provider for .Net. spatial queries return no data unless the indexes on the queried table are rebuilt, the query returns data when executed using sql*plus.
    we're coding in C#, the database version is 9.2.
    is this a bug, has it been reported, and is there any documentation on it?
    are they any on-line resources i could refer to?
    any help will be appreciated (this is extremely urgent)
    thanks
    santosh sewlal

    Seems something specific to Spatial and not to ODP.NET. Please work with Oracle Support to resolve this issue.

  • Does IMovie '11 Use Multiple Cores?

    I'm trying to decide between a high end 4 core (4G i7) iMac and a (3.5G Xeon) 6 core 2013 Mac Pro. Currently I have a 2009 Mac Pro. I do light video editing, and was wondering whether iMovie '11 would take advantage of the extra 2 cores, as opposed to the faster speed of the iMac 4 cores...
    Thoughts?

    I'm not sure that iMovie '11 will use all the cores.  iMovie '13 (version 10) will BUT....  If you are going to splash 3000-4000 $ on a high-end mac why not layout a paltry additional $300 on Final Cut Pro 10.1.x which is FAR more powerful and less frustrating to use than iMovie and will definitely make best use of  your processing power.  
    Geoff.

  • Using multiple 'and' conditions in a SQL query

    Is it possible to reduce the SQL required to query using multiple 'and' conditions, e.g. I have a query like the following:
    select stat.personal_id, appt.username, appt.password, apps.rgn_apt_id, apps.apy_apn_id
    from apy_ast_application_status stat, rgn_usr_user appt, rgn_aps_applications apps
    where stat.apy_apn_id = apps.rgn_apt_id
    and apps.rgn_apt_id = appt.rgn_apt_id
    and stat.application_completed is null
    and stat.application_started_date > '01-MAY-11'
    and stat.amount_paid is null
    and stat.personal_details = 'C'
    and stat.further_details = 'C'
    and stat.education = 'C'
    and stat.employment = 'C'
    and stat.personal_statement = 'C'
    and stat.choices = 'C'
    and stat.reference = 'C'
    and stat.student_finance = 'C'
    Is there a way, to reduce all the multiple 'and' queries, to be read from say one line? If you know what I mean.......

    Ah, Ok this looks nice, thanks very much. It doesn't quite run as is because the stat.amount_paid query value is 'is null', while the others are 'C'. I tried amending the relevant line to various versions of the following:-
    in (select 'is null' 'C','C','C','C','C','C','C','C' from dual)
    which doesn't work.
    I can get the following to work so I am assuming that the it is not possible to use different query values within the brackets of the 'in (select....' statement?
    select stat.personal_id, appt.username, appt.password, apps.rgn_apt_id, apps.apy_apn_id
    from apy_ast_application_status stat, rgn_usr_user appt, rgn_aps_applications apps
    where stat.apy_apn_id = apps.rgn_apt_id
    and apps.rgn_apt_id = appt.rgn_apt_id
    and stat.application_completed is null
    and stat.application_started_date > '01-MAY-11'
    and stat.amount_paid is null
    and (stat.personal_details, stat.further_details, stat.education,
    stat.employment, stat.personal_statement, stat.choices, stat.reference, stat.student_finance)
    in (select 'C','C','C','C','C','C','C','C' from dual)
    Thanks for everybodys help - the suggested alternatives seem so much more elegant

  • Can FMLE use 6 core fully?

    I am recently want to upgrade my computer for higher quality streaming.
    I am looking at AMD 1095(6core) and 970(4core).Since stream is about video encording, 6core should have better result.
    But i am not sure if FMLE can fully use the advantage of 6 core processor.
    Is 1095 better than 970 in this suition? or there are some other cup you will recommend. (perfer AMD but i am open mind)

    FMLE can use multiple cores. it is certified for 8 core and 16 cores machines as well. for single stream, FMLE may not use all the cores fully but for multiple streams higher the number of cores better the performance is.

  • SELECT query from multiple databases

    Hi,
    Is it possible to run a SELECT query using multiple DBs' tables, like outer joining them. One of the DBs is Sybase.
    Thanks in advance

    A TopLink session can span multiple databases if they can be accessed through a single connection. A single select would require the database to handle the aggregation as mentioned in the other post.
    Alternatively TopLink's session broker will support making a single session present persistent types from multiple independent databases. This approach will not support a single SELECT spanning the databases though.
    Doug

  • FCE 4 vs. 3.5 with multiple cores

    Hello,
    I've just upgraded to an 8-core Mac Pro. I've been using FCE 3.5 HD, and wondering if there's much difference between how it uses multiple cores for things like rendering, vs. FCE 4. I don't need the new video formats that 4 supports, so was wondering if I would notice any speed improvements by upgrading. Thanks.
    Dan

    Hi Mark,
    Thanks for the reply.
    FCP cost's $300 - do I really need that if Motion 5 does the same thing?  If it gets my render speed down significantly I'm willing but I won't be using it for anything else - I just want to make sure I get a good return on my investment.
    And "compressor" is that a part of FCP or another program to purchase?

  • Can iMovie 11 use quad core?

    Does anyone know, if iMovie 11 can make use of all of the 4 cores on the new Macbook Pro I7 processor? I am thinking of buying either the quad core, or the dual core Macbook Pro for iMovie related work.
    I asked this at the Apple store, but they were not sure.
    Thank you.

    I am using a MacPro (3/2014) with 6 cores and 16GB of RAM. 
    Encoding a 58 minute video in SD is estimated to take 1 hr 10 minutes. 
    While the CPU monitor shows the "ProTranscoderToolsb" running at 460% and I'Movie at 58%, it is not clear to me whether this means that the I'Movie is using multiple cores (i.e. 5 of my 6 cores) and is multi-threaded.
    Does anyone have an answer for this.
    I was surprised that this render would take this long as I upgraded my old MacPro (2008 1st generation but with 4 cores) precisely for the additional rendering power.
    My impression is like some others, that if I'Movie is using multi-threading, it is not using it very efficiently.  Apple needs to address this on all of its products.  It is ironic that Adobe (Photoshop 6 and CC which rip) appear to use the new MacPro's power more effectively than Apple software products.

  • How to use one af:query for multiple VOs

    Hi all,
    How can we use an af:query component to query on multiple VOs?
    Think of a page with search area and a tabbed pannel with two tables based on different view objects.
    Any ideas?
    Thanks
    Version
    ADF Business Components 11.1.1.56.60
    Java(TM) Platform 1.6.0_18
    Oracle IDE 11.1.1.3.37.56.60
    Edited by: Barbara Gelabert on 28-dic-2010 6:55

    Hi Santosh,
    Not yet implemented, but I was thinking on overriding the query listener and creating a view critera on the second view object as a copy of the first one. That involves capturing operands, operators and values set and then applying the criteria and executing the query.
    Anyway, in case you don't need complex operators in the search area but can add them as where clauses to the query statement, you can use search forms instead of query components as Shay Shmeltzer suggests in [url http://blogs.oracle.com/shay/2010/12/combining_multiple_queries_and.html?goback=.gde_1002457_news_308820955]his post.
    Regards,
    Barbara

Maybe you are looking for