...
Find the
change_request_idÂ
of the most recent bulk load.Code Block language sql -- Get the change_request_id of the most recent bulk load: SELECT change_request_id FROM public.change_requests WHERE requestor_comment LIKE 'bulk load change request' ORDER BY change_request_id DESC LIMIT 1; -- Make note of this id for the queries in the subsequent steps.
Count and view new base addresses associated with the change request.
Code Block language sql -- Count new base addresses SELECT COUNT (*) FROM public.addresses WHERE activate_change_request_id = change_request_id_goes_here AND unit_num IS NULL; -- View new base addresses SELECT * FROM public.addresses WHERE activate_change_request_id = change_request_id_goes_here AND unit_num IS NULL;
Count and view new unit addresses associated with the change request.
Code Block language sql --- Count new unit addresses SELECT COUNT (*) FROM public.addresses WHERE activate_change_request_id = change_request_id_goes_here AND NOT unit_num IS NULL; -- View new unit addresses SELECT * FROM public.addresses WHERE activate_change_request_id = change_request_id_goes_here AND NOT unit_num IS NULL;
Count and view all new addresses associated with the change request.
Code Block language sql -- Count all new addresses SELECT COUNT (*) FROM public.addresses WHERE activate_change_request_id = change_request_id_goes_here; -- View all new addresses SELECT * FROM public.addresses WHERE activate_change_request_id = change_request_id_goes_here;
Count/view public.address_base records associated with any new public.addresses records added to the EAS
Code Block language sql -- Count/view public.address_base records associated with any new public.addresses records added to the EAS SELECT COUNT(*) FROM public.address_base, public.addresses WHERE public.address_base.address_base_id = public.addresses.address_base_id AND public.addresses.activate_change_request_id = change_request_id_goes_here; SELECT activate_change_request_id, address_id, public.address_base.address_base_id, base_address_prefix, base_address_num, base_address_suffix, public.address_base.create_tms, public.address_base.retire_tms, zone_id, street_segment_id, distance_to_segment, geometry, public.address_base.last_change_tms FROM public.address_base, public.addresses WHERE public.address_base.address_base_id = public.addresses.address_base_id AND public.addresses.activate_change_request_id = change_request_id_goes_here;
Optional: count all records in the database for use in a before/after record count comparison.
Code Block language sql SELECT schemaname,relname,n_live_tup FROM pg_stat_user_tables ORDER BY schemaname,relname,n_live_tup;
Free space after large Bulk Loader batches
...