Comments and answers for "How to store the result of a where close to use in the where clause of a reader ?" https://knowledge.亚搏在线safe.com/questions/88109/how-to-store-the-result-of-a-where-close-to-use-in.html The latest comments and answers for the question "How to store the result of a where close to use in the where clause of a reader ?" Comment by david_r on david_r's comment https://knowledge.亚搏在线safe.com/comments/88306/view.html

This is what I had i mind,it will prevent you from reading the entire postgis table and as long as the FID column is indexed it should be fairly quick:

Although if you have a "large" number of FIDs,then you should look into the suggestion from@egomm,it will scale much better (but requires that you have sufficient rights).

Tue,12 Mar 2019 13:44:56 GMT david_r
Comment by david_r on david_r's answer https://knowledge.亚搏在线safe.com/comments/88305/view.html

I agree,in particular if there's a non-trivial number of records to join.Although it does depend on having sufficient rights.

Tue,2019年3月12日13:40:06格林尼治时间 david_r
Comment by arnovananrooij on arnovananrooij's comment https://knowledge.亚搏在线safe.com/comments/88180/view.html

Aha@tsirkuse,then you should use the FeatureReader.This transformer is the same as the DatabaseJoiner except that you can also do a spatial join..

Fri,08 Mar 2019 16:37:19 GMT arnovananrooij
Answer by egomm https://knowledge.亚搏在线safe.com/answers/88177/view.html

I've always found the most efficient way to do this is to write a temporary table in the POSTGIS database then use an sqlexecutor to return the matched records.



Fri,08 Mar 2019 15:57:29 GMT egomm
Comment by tsirkuse on tsirkuse's answer https://knowledge.亚搏在线safe.com/comments/88176/view.html

I don't see how that helps me not reading half a milion post gis records I don't need....Maybe I am missing something,but I really don't see it.I want to use the id's selected by my sqlcreator (oracle) in my post-gis reader.So I need to somehow store the values in a list that I can use in the where clause...

Fri,08 Mar 2019 15:40:52 GMT tsirkuse
Comment by tsirkuse on tsirkuse's answer https://knowledge.亚搏在线safe.com/comments/88175/view.html

Ah,tried that first,not possible cause what I want to join is the geometry.Except if there is a work around for that problem?

Fri,08 Mar 2019 15:30:39 GMT tsirkuse
Answer by itay https://knowledge.亚搏在线safe.com/answers/88138/view.html

A nice trick on how to create the where IN clause (something I learnt a long time ago from@erik_janand I am still using) is:

If you have >1000 features (ID's) you will need to do the following:

  • Add a Counter starting with 0
  • Add an ExpressionEvaluator with floor(@Value(_count)/1000,0).
  • Add an Aggregator with group by on _result and concatenate the attributes you want in the where clause.

Hope this helps.

Itay

Thu,07 Mar 2019 20:11:32 GMT itay
Answer by arnovananrooij https://knowledge.亚搏在线safe.com/answers/88111/view.html

Hi@tsirkuse,I would use the DatabaseJoiner after the SQLCreator to read the PostGIS database.

Thu,07 Mar 2019 14:37:13 GMT arnovananrooij
Answer by david_r https://knowledge.亚搏在线safe.com/answers/88110/view.html

Rather than using the regular reader,you could simply connect your SQLCreator to a FeatureReader,with the FID in the where-clause.

Thu,07 Mar 2019 14:35:13 GMT david_r