How to query if meta_key does exist or not?

Adding a NOT EXISTS clause should force LEFT JOINs:

    'meta_query' => array(
        'relation' => 'OR',
        array('key' => 'file_gallery', 'value' => '1', 'compare' => '!='),
        array('key' => 'file_gallery', 'compare' => 'NOT EXISTS'),
    ),

techhipbettruvabetnorabahisbahis forumuedueduseduedueduseduseduedusedusedu