Skip to main content

PostGIS performance tricks


lambertus
Enthusiast
Forum|alt.badge.img+12

Recently I put different tables into a PostGIS database. One of these tables contains 23M unique records and does not contain spatial data. I would like to read them into a FME workbench. Do you have some suggestions how I could improve my reading process?

  1. Is it possible for example to preselect already a set of columns I need while reading my table using 'SQL to Run before Read'?’ If so do you have a example SQL querry?
     
  2. Is there a performance difference between  'SQL to Run before Read'?’ and the WHERE clause option in the Constraints menu?

 

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+50
  • Celebrity
  • October 1, 2024

I wouldn’t worry about using the ‘SQL to Run Before Read’ functionality.

I think your best approach would be to use the SQLExecutor. You can form a complete SQL statement in there, with joins, subqueries etc and also specify your fields you want to read in.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/sqlexecutor.htm


lambertus
Enthusiast
Forum|alt.badge.img+12
  • Author
  • Enthusiast
  • October 2, 2024

@hkingsbury thanks, works perfect!

Do you of someone else know the SQL querry to use my initiator of the SQL executor as SpatialFilter on the imported table? Like you do in a FeatureReader with Initiator OGC- Interesects Result ?

A reference file or guide is also fine to me

Update: I found this interesting article:
|Performing Native Spatial Queries on Database Tables Using the SQLExecutor – FME Support Center (safe.com)
I will dive into that one


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings