private int preWarm(Connection c, int mainIndex, int secondaryIndex, int vectors)
			throws SQLException {
		try (Statement st = c.createStatement()) {
			// Try to load the entire main index into the PostgreSQL cache
			int res = -1;
			String queryString;
			st.execute("CREATE EXTENSION IF NOT EXISTS pg_prewarm");
			if (mainIndex != 0) {
				if (mainIndex == 1) {
					queryString = "SELECT pg_prewarm('vectable_vec_idx','read')";
				}
				else {
					queryString = "SELECT pg_prewarm('vectable_vec_idx')";
				}
				try (ResultSet rs = st.executeQuery(queryString)) {
					if (rs.next()) {
						res = rs.getInt(1); // Number of blocks that were successfully prewarmed
						while (rs.next()) { // Shouldn't be any more rows
							// TODO: Should be no need to exhaust results
						}
					}
				}
			}
			if (secondaryIndex != 0) {
				// Try to convince the OS to load the secondary vector table index
				// into RAM
				if (secondaryIndex == 1) {
					queryString = "SELECT pg_prewarm('vectable_id_key','read')";
				}
				else {
					queryString = "SELECT pg_prewarm('vectable_id_key')";
				}
				try (ResultSet rs = st.executeQuery(queryString)) {
					while (rs.next()) {
						// TODO: Should be no need to exhaust results
						// int val = rs.getInt(1);
					}
				}
			}
			if (vectors != 0) {
				// Try to convince the OS to load the vector table into RAM
				if (vectors == 1) {
					queryString = "SELECT pg_prewarm('vectable','read')";
				}
				else {
					queryString = "SELECT pg_prewarm('vectable')";
				}
				try (ResultSet rs = st.executeQuery(queryString)) {
					while (rs.next()) {
						// TODO: Should be no need to exhaust results
						// int val = rs.getInt(1);
					}
				}
			}
			st.execute("DROP EXTENSION pg_prewarm");

			return res;
		}
	}
Attempt to preload some of the main tables and indices into cache or RAM

@param mainIndex
           For the main index -- 0=don't load 1=load into RAM 2=load into
           cache
@param secondaryIndex
           For the secondary index -- 0=don't load 1=load into RAM 2=load
           into cache
@param vectors
           For vectors -- 0=don't load 1=load into RAM 2=load into cache
@return the number of blocks loaded for the main index
@throws SQLException if there is a problem creating or executing the query
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/PostgresFunctionDatabase.java