Bird
0
0

Which of the following is the correct way to set effective_cache_size to 4GB in PostgreSQL's configuration file?

easy📝 Syntax Q12 of 15
PostgreSQL - Performance Tuning
Which of the following is the correct way to set effective_cache_size to 4GB in PostgreSQL's configuration file?
Aeffective_cache_size = 4000MB
Beffective_cache_size = '4GB'
Ceffective_cache_size = 4g
Deffective_cache_size = 4GB
Step-by-Step Solution
Solution:
  1. Step 1: Check PostgreSQL config syntax for memory sizes

    PostgreSQL accepts memory sizes with units like KB, MB, GB without quotes.
  2. Step 2: Validate each option

    effective_cache_size = 4GB uses correct syntax: number + unit without quotes. effective_cache_size = '4GB' uses quotes (invalid). effective_cache_size = 4000MB uses MB but 4000MB is less than 4GB. effective_cache_size = 4g uses lowercase 'g' which is invalid; units must be uppercase.
  3. Final Answer:

    effective_cache_size = 4GB -> Option D
  4. Quick Check:

    Config memory size = number + uppercase unit [OK]
Quick Trick: Use number + uppercase unit without quotes for memory sizes [OK]
Common Mistakes:
  • Adding quotes around memory size values
  • Using lowercase units like 'g' instead of 'GB'
  • Confusing MB and GB values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes