Don't to SQL for any thread other than the first one
SQL is turned off other threads other than 0, so get_sqL_id can be enabled