I also am able to create a temporary table to store migrations, which may be the best option (no longer need to join new columns in query) If you could help with that as well.. Thank you From: smerlo50@xxxxxxxxxxx To: bricklen@xxxxxxxxx CC: pgsql-admin@xxxxxxxxxxxxxx Subject: Re: Slow Query - PostgreSQL 9.2 Date: Tue, 12 Jan 2016 20:28:53 +0000 Hi Bricklen.. Thank you for your help... Thank you so much... It would be helpful to supply the output of "\d gorfs.nodes" and "\d gorfs.inode_segments" so we can see the actual indexes and constraints that exist. Remember that gorfs.nodes is a view. I've created the INDEX you told me to:
It seems on the EXPLAIN ANALYZE that it wasn't used! gorfs.nodes: DBNAME=# \d gorfs.nodes teste5.txtView "gorfs.nodes"Column | Type | Modifiers--------------------+--------------------------------+-----------node_full_path | "gorfs"."absolute_pathname" |parent_inode_id | "gorfs"."ino_t" |inode_id | "gorfs"."ino_t" |relative_path | character varying |raw_mode | bigint |object_type | "gorfs"."mode_t_constant_name" |setuid | boolean |setgid | boolean |sticky | boolean |permissions | bit(9) |links_count | "gorfs"."nlink_t" |owner_uid | "gorfs"."uid_t" |owner_gid | "gorfs"."gid_t" |data_length | "gorfs"."off_t" |last_accessed | "gorfs"."time_t" |last_modified | "gorfs"."time_t" |last_changed | "gorfs"."time_t" |checksum_md5 | "md5_hash" |media_type | "text" |target | "text" |file_data | "bytea" |is_external | boolean |data_length_target | "gorfs"."off_t" |Triggers:"i_iud_action_changes" INSTEAD OF INSERT OR DELETE OR UPDATE ON "gorfs"."nodes" FOR EACH ROW EXECUTE PROCEDURE"gorfs"."tf_nodes_action_changes"() gorfs.inode_segments:
Also, pasting your EXPLAIN plan into http://explain.depesz.com/ and submitting the link in your post is usually easier to read than pasting it into an email. Ok. I'll do it. create index concurrently nodes_last_modified_rel_path_ gorfs.nodes is a view:
|