<p>Not in Craft 2 without completely bypassing ElementCriteriaModel and building your own SQL query.</p>

<p>In Craft 3 (<a href="https://craftcms.com/3" rel="noreferrer">currently in beta</a>) you can, though – you can override which columns get selected in your element queries, and you can choose whether you want the data returned as element models or just plain arrays.</p>

<pre class="lang-php prettyprint-override"><code>{% set entries = craft.entries
    .section('news')
    .select('elements.id', 'content.title')
    .asArray()
    .all() %}
</code></pre>

CC BY-SA 3.0
2017-03-26T19:10:00.300Z
Thanks Brandon. Awesome to know that's been addressed. I'm definitely looking forward to Craft 3.
JamesNZ
CC BY-SA 3.0
2017-03-23T12:58:13.877Z
2017-03-23T12:58:13.877Z
Brandon Kelly
<p>The performance of the ElementCriteriaModel for lookups is killing me.</p>

<p>I have 300 or so "People" entries in a craft site and trying to load them just for a basic listing page takes forever. There's just so much overhead.</p>

<p>In this case of i.e. a listing page, I need the <strong>entry title</strong>, <strong>slug</strong> and an <strong>image</strong> field (which I'm eager loading). I don't need all of the other fields and overhead it loads.</p>

<p>Is there a way to get more acceptable performance for cases like this specific one (listing page with large number of entries and limited data needed)? Or am I going to have to bypass the element criterea stuff and do the lookups myself in SQL?</p>

<p>Thanks</p>

CC BY-SA 3.0
2017-03-23T08:02:52.290Z
If pagination isn't an option, you'll need to bypass the `ElementCriteriaModel`. I ran into this recently, with Categories. Each `ElementModel` occupies an awful lot of memory, and there's no way to create a "partial" model from an `ElementCriteriaModel` query.
Stephen Lewis
CC BY-SA 3.0
2017-03-26T19:05:56.847Z
Unfortunately pagination isn't really an option here. Thanks Stephen.
JamesNZ
<elementcriteriamodel>
Performance when loading lots of Elements but only need limited data
# Performance when loading lots of Elements but only need limited data

(Asked by: username_0 on 2017-03-23)

The performance of the ElementCriteriaModel for lookups is killing me.

I have 300 or so "People" entries in a craft site and trying to load them just for a basic listing page takes forever. There's just so much overhead.

In this case of i.e. a listing page, I need the **entry title**, **slug** and an **image** field (which I'm eager loading). I don't need all of the other fields and overhead it loads.

Is there a way to get more acceptable performance for cases like this specific one (listing page with large number of entries and limited data needed)? Or am I going to have to bypass the element criterea stuff and do the lookups myself in SQL?

Thanks

**Tags:** elementcriteriamodel

> **Comments:**
> **username_1**: If pagination isn't an option, you'll need to bypass the `ElementCriteriaModel`. I ran into this recently, with Categories. Each `ElementModel` occupies an awful lot of memory, and there's no way to create a "partial" model from an `ElementCriteriaModel` query.  
> **username_0**: Unfortunately pagination isn't really an option here. Thanks Stephen.  

---

## 1 answers

### Answer by username_2 on 2017-03-23. Score: 5 | Accepted answer

Not in Craft 2 without completely bypassing ElementCriteriaModel and building your own SQL query.
In Craft 3 (currently in beta) you can, though – you can override which columns get selected in your element queries, and you can choose whether you want the data returned as element models or just plain arrays.
{% set entries = craft.entries
    .section('news')
    .select('elements.id', 'content.title')
    .asArray()
    .all() %}

> **Comments:**
> **username_0**: Thanks Brandon. Awesome to know that's been addressed. I'm definitely looking forward to Craft 3.  

---

