Answers.Body: <p>You're right, this can only be accomplished with a Matrix field.</p>
  
  <p>That said, you could probably accomplish what you need via a <strong>custom field type</strong>. You'd need to create a custom plugin (obviously), but you could probably build something that simply stores an <em>array of asset IDs</em>:</p>
  
  <pre><code>[12,33,42,10,10,10]
  </code></pre>
  
  <p>I won't diver deeper into what the mechanics of that plugin &amp; field type should be... that's a bit beyond the scope of this question.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-12T17:00:52.137Z
Answers.LastActivityDate: 2017-07-12T17:00:52.137Z
Answers.UserDisplayName: Lindsey D
Body: <p>My customer wants a videoplaylist for users.</p>
  
  <p>Idealy I'd like to have a assets relation field for the playlist and relate all the videos in said playlist.</p>
  
  <p>The problem is if a user wants the same video several times in the playlist. 
  ( like in a loop ).</p>
  
  <p>As far as I know it's only possible to relate an entry/asset once in the same relation field.</p>
  
  <p>The solution for me would be to add a matrix-block for each video in the playlist, but since there are thousands of playlists the db grows way more than expected.</p>
  
  <p>Without matrix field: around 30MB
  With matrix blocks: around 200MB.</p>
  
  <p>The site slowed down quite a bit and the searchindex table grew to about 80MB.</p>
  
  <p>Is there another way to implement this or a ideally a way to relate an entry several time in one field?</p>
  
Tags: <relations><performance>
Title: Can I set the same relation in a field multiple times?
ThreadText: # Can I set the same relation in a field multiple times?
  
  (Asked by: username_0 on 2017-07-12)
  
  My customer wants a videoplaylist for users.
  
  Idealy I'd like to have a assets relation field for the playlist and relate all the videos in said playlist.
  
  The problem is if a user wants the same video several times in the playlist.
  ( like in a loop ).
  
  As far as I know it's only possible to relate an entry/asset once in the same relation field.
  
  The solution for me would be to add a matrix-block for each video in the playlist, but since there are thousands of playlists the db grows way more than expected.
  
  Without matrix field: around 30MB
  With matrix blocks: around 200MB.
  
  The site slowed down quite a bit and the searchindex table grew to about 80MB.
  
  Is there another way to implement this or a ideally a way to relate an entry several time in one field?
  
  **Tags:** relations, performance
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-07-12. Score: 2 | Accepted answer
  
  You're right, this can only be accomplished with a Matrix field.
  
  That said, you could probably accomplish what you need via a **custom field type**. You'd need to create a custom plugin (obviously), but you could probably build something that simply stores an *array of asset IDs*:
  
  ```
  [12,33,42,10,10,10]
  
  ```
  
  I won't diver deeper into what the mechanics of that plugin & field type should be... that's a bit beyond the scope of this question.
  
  
  ---
  
  